Browse Source

Projects, solution and fixes for Visual Studio 2013.

cl-refactor
Tim Hughes 11 years ago
parent
commit
0dc9bc82fe
  1. 7
      .gitignore
  2. 68
      Ethereum.sln
  3. 184
      eth/Ethereum.vcxproj
  4. 1
      libethereum/BlockChain.h
  5. 5
      libethereum/Common.cpp
  6. 5
      libethereum/Common.h
  7. 6
      libethereum/Dagger.cpp
  8. 19
      libethereum/LibEthereum.props
  9. 175
      libethereum/LibEthereum.vcxproj
  10. 32
      libethereum/LibEthereum.vcxproj.filters
  11. 20
      libethereum/RLP.cpp
  12. 4
      libethereum/RLP.h
  13. 19
      libethereum/State.cpp
  14. 2
      libethereum/Transaction.cpp
  15. 12
      libethereum/Trie.cpp
  16. 1
      libethereum/Trie.h
  17. 2
      libethereum/vector_ref.h
  18. 184
      test/Test.vcxproj
  19. 6
      test/main.cpp

7
.gitignore

@ -12,4 +12,11 @@
*.la
*.a
# VS stuff
build
ipch
*.sdf
*.opensdf
*.suo
*.user

68
Ethereum.sln

@ -0,0 +1,68 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibEthereum", "libethereum\LibEthereum.vcxproj", "{7050C7CF-7551-48BE-8E57-92235906C13A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestMining", "test\TestMining.vcxproj", "{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "test\Test.vcxproj", "{3F3E389B-88DE-41D5-A73B-4F6036E18B36}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "..\cryptopp562\cryptlib.vcxproj", "{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ethereum", "eth\Ethereum.vcxproj", "{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7050C7CF-7551-48BE-8E57-92235906C13A}.Debug|Win32.ActiveCfg = Debug|Win32
{7050C7CF-7551-48BE-8E57-92235906C13A}.Debug|Win32.Build.0 = Debug|Win32
{7050C7CF-7551-48BE-8E57-92235906C13A}.Debug|x64.ActiveCfg = Debug|x64
{7050C7CF-7551-48BE-8E57-92235906C13A}.Debug|x64.Build.0 = Debug|x64
{7050C7CF-7551-48BE-8E57-92235906C13A}.Release|Win32.ActiveCfg = Release|Win32
{7050C7CF-7551-48BE-8E57-92235906C13A}.Release|Win32.Build.0 = Release|Win32
{7050C7CF-7551-48BE-8E57-92235906C13A}.Release|x64.ActiveCfg = Release|x64
{7050C7CF-7551-48BE-8E57-92235906C13A}.Release|x64.Build.0 = Release|x64
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Debug|Win32.ActiveCfg = Debug|Win32
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Debug|Win32.Build.0 = Debug|Win32
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Debug|x64.ActiveCfg = Debug|x64
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Debug|x64.Build.0 = Debug|x64
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Release|Win32.ActiveCfg = Release|Win32
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Release|Win32.Build.0 = Release|Win32
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Release|x64.ActiveCfg = Release|x64
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Release|x64.Build.0 = Release|x64
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|Win32.ActiveCfg = Debug|Win32
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|Win32.Build.0 = Debug|Win32
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|x64.ActiveCfg = Debug|x64
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|x64.Build.0 = Debug|x64
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|Win32.ActiveCfg = Release|Win32
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|Win32.Build.0 = Release|Win32
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|x64.ActiveCfg = Release|x64
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|x64.Build.0 = Release|x64
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.ActiveCfg = Debug|Win32
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.Build.0 = Debug|Win32
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|x64.ActiveCfg = Debug|x64
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|x64.Build.0 = Debug|x64
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.ActiveCfg = Release|Win32
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.Build.0 = Release|Win32
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|x64.ActiveCfg = Release|x64
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|x64.Build.0 = Release|x64
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.ActiveCfg = Debug|Win32
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.Build.0 = Debug|Win32
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|x64.ActiveCfg = Debug|x64
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|x64.Build.0 = Debug|x64
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|Win32.ActiveCfg = Release|Win32
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|Win32.Build.0 = Release|Win32
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|x64.ActiveCfg = Release|x64
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

184
eth/Ethereum.vcxproj

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<Keyword>Win32Proj</Keyword>
<RootNamespace>Ethereum</RootNamespace>
<ProjectName>Ethereum</ProjectName>
<ProjectGuid>{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\libethereum\LibEthereum.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\libethereum\LibEthereum.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\libethereum\LibEthereum.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\libethereum\LibEthereum.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../libethereum</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../libethereum</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../libethereum</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StringPooling>true</StringPooling>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../libethereum</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StringPooling>true</StringPooling>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\cryptopp562\cryptlib.vcxproj">
<Project>{3423ec9a-52e4-4a4d-9753-edebc38785ef}</Project>
</ProjectReference>
<ProjectReference Include="..\libethereum\LibEthereum.vcxproj">
<Project>{7050c7cf-7551-48be-8e57-92235906c13a}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

1
libethereum/BlockChain.h

@ -22,7 +22,6 @@
#pragma once
#include "Common.h"
#include <leveldb/db.h>
namespace ldb = leveldb;
namespace eth

5
libethereum/Common.cpp

@ -19,7 +19,10 @@
* @date 2014
*/
#pragma warning(push)
#pragma warning(disable:4244)
#include <sha3.h>
#pragma warning(pop)
#include <random>
#include "Common.h"
#include "Exceptions.h"
@ -79,7 +82,7 @@ bytes eth::fromUserHex(std::string const& _s)
std::vector<uint8_t> ret;
ret.reserve((_s.size() - s) / 2);
for (uint i = s; i < _s.size(); i += 2)
ret.push_back(fromHex(_s[i]) * 16 + fromHex(_s[i + 1]));
ret.push_back((byte)(fromHex(_s[i]) * 16 + fromHex(_s[i + 1])));
return ret;
}

5
libethereum/Common.h

@ -23,6 +23,11 @@
#pragma once
// way to many uint to size_t warnings in 32 bit build
#ifdef _M_IX86
#pragma warning(disable:4244)
#endif
#include <array>
#include <map>
#include <set>

6
libethereum/Dagger.cpp

@ -1,7 +1,10 @@
#include <boost/detail/endian.hpp>
#include <chrono>
#include <array>
#pragma warning(push)
#pragma warning(disable:4244)
#include <sha3.h>
#pragma warning(pop)
#include <random>
#include "Common.h"
#include "Dagger.h"
@ -44,7 +47,8 @@ inline void update(_T& _sha, _U const& _value)
int i = 0;
for (_U v = _value; v; ++i, v >>= 8) {}
byte buf[32];
toBigEndian(_value, bytesRef(buf, i));
bytesRef bufRef(buf, i);
toBigEndian(_value, bufRef);
_sha.Update(buf, i);
}

19
libethereum/LibEthereum.props

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>$(IncludePath);../../boost_1_55_0;../../leveldb-1.15.0/include;../../cryptopp562;../../secp256k1/include</IncludePath>
<OutDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</OutDir>
<IntDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4100;4127;4505;4512;</DisableSpecificWarnings>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

175
libethereum/LibEthereum.vcxproj

@ -0,0 +1,175 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AddressState.h" />
<ClInclude Include="BlockChain.h" />
<ClInclude Include="BlockInfo.h" />
<ClInclude Include="Common.h" />
<ClInclude Include="Dagger.h" />
<ClInclude Include="Exceptions.h" />
<ClInclude Include="Instruction.h" />
<ClInclude Include="PeerNetwork.h" />
<ClInclude Include="RLP.h" />
<ClInclude Include="State.h" />
<ClInclude Include="Transaction.h" />
<ClInclude Include="TransactionQueue.h" />
<ClInclude Include="Trie.h" />
<ClInclude Include="vector_ref.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AddressState.cpp" />
<ClCompile Include="BlockChain.cpp" />
<ClCompile Include="BlockInfo.cpp" />
<ClCompile Include="Common.cpp" />
<ClCompile Include="Dagger.cpp" />
<ClCompile Include="PeerNetwork.cpp" />
<ClCompile Include="RLP.cpp" />
<ClCompile Include="State.cpp" />
<ClCompile Include="Transaction.cpp" />
<ClCompile Include="TransactionQueue.cpp" />
<ClCompile Include="Trie.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7050C7CF-7551-48BE-8E57-92235906C13A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>LibEthereum</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="LibEthereum.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="LibEthereum.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="LibEthereum.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="LibEthereum.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</OutDir>
<IntDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</OutDir>
<IntDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</OutDir>
<IntDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatWarningAsError>true</TreatWarningAsError>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatWarningAsError>true</TreatWarningAsError>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatWarningAsError>true</TreatWarningAsError>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

32
libethereum/LibEthereum.vcxproj.filters

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClInclude Include="TransactionQueue.h" />
<ClInclude Include="Trie.h" />
<ClInclude Include="vector_ref.h" />
<ClInclude Include="AddressState.h" />
<ClInclude Include="BlockChain.h" />
<ClInclude Include="BlockInfo.h" />
<ClInclude Include="Common.h" />
<ClInclude Include="Dagger.h" />
<ClInclude Include="Exceptions.h" />
<ClInclude Include="Instruction.h" />
<ClInclude Include="PeerNetwork.h" />
<ClInclude Include="RLP.h" />
<ClInclude Include="State.h" />
<ClInclude Include="Transaction.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Trie.cpp" />
<ClCompile Include="AddressState.cpp" />
<ClCompile Include="BlockChain.cpp" />
<ClCompile Include="BlockInfo.cpp" />
<ClCompile Include="Common.cpp" />
<ClCompile Include="Dagger.cpp" />
<ClCompile Include="PeerNetwork.cpp" />
<ClCompile Include="RLP.cpp" />
<ClCompile Include="State.cpp" />
<ClCompile Include="Transaction.cpp" />
<ClCompile Include="TransactionQueue.cpp" />
</ItemGroup>
</Project>

20
libethereum/RLP.cpp

@ -116,7 +116,7 @@ eth::uint RLP::items() const
RLPStream& RLPStream::appendString(bytesConstRef _s)
{
if (_s.size() < 0x38)
m_out.push_back(_s.size() | 0x40);
m_out.push_back((byte)(_s.size() | 0x40));
else
pushCount(_s.size(), 0x40);
uint os = m_out.size();
@ -128,7 +128,7 @@ RLPStream& RLPStream::appendString(bytesConstRef _s)
RLPStream& RLPStream::appendString(string const& _s)
{
if (_s.size() < 0x38)
m_out.push_back(_s.size() | 0x40);
m_out.push_back((byte)(_s.size() | 0x40));
else
pushCount(_s.size(), 0x40);
uint os = m_out.size();
@ -148,7 +148,7 @@ RLPStream& RLPStream::appendRaw(bytesConstRef _s)
RLPStream& RLPStream::appendList(uint _count)
{
if (_count < 0x38)
m_out.push_back(_count | 0x80);
m_out.push_back((byte)(_count | 0x80));
else
pushCount(_count, 0x80);
return *this;
@ -157,11 +157,11 @@ RLPStream& RLPStream::appendList(uint _count)
RLPStream& RLPStream::append(uint _i)
{
if (_i < 0x18)
m_out.push_back(_i);
m_out.push_back((byte)_i);
else
{
auto br = bytesRequired(_i);
m_out.push_back(br + 0x17); // max 8 bytes.
m_out.push_back((byte)(br + 0x17)); // max 8 bytes.
pushInt(_i, br);
}
return *this;
@ -174,7 +174,7 @@ RLPStream& RLPStream::append(u160 _i)
else
{
auto br = bytesRequired(_i);
m_out.push_back(br + 0x17); // max 8 bytes.
m_out.push_back((byte)(br + 0x17)); // max 8 bytes.
pushInt(_i, br);
}
return *this;
@ -187,7 +187,7 @@ RLPStream& RLPStream::append(u256 _i)
else
{
auto br = bytesRequired(_i);
m_out.push_back(br + 0x17); // max 8 bytes.
m_out.push_back((byte)(br + 0x17)); // max 8 bytes.
pushInt(_i, br);
}
return *this;
@ -201,11 +201,11 @@ RLPStream& RLPStream::append(bigint _i)
{
uint br = bytesRequired(_i);
if (br <= 32)
m_out.push_back(bytesRequired(_i) + 0x17); // max 32 bytes.
m_out.push_back((byte)(bytesRequired(_i) + 0x17)); // max 32 bytes.
else
{
auto brbr = bytesRequired(br);
m_out.push_back(0x37 + brbr);
m_out.push_back((byte)(0x37 + brbr));
pushInt(br, brbr);
}
pushInt(_i, br);
@ -216,7 +216,7 @@ RLPStream& RLPStream::append(bigint _i)
void RLPStream::pushCount(uint _count, byte _base)
{
auto br = bytesRequired(_count);
m_out.push_back(br + 0x37 + _base); // max 8 bytes.
m_out.push_back((byte)(br + 0x37 + _base)); // max 8 bytes.
pushInt(_count, br);
}

4
libethereum/RLP.h

@ -223,7 +223,7 @@ public:
else{}
_N ret;
unsigned s = std::min<unsigned>(_N::size, items());
size_t s = std::min((size_t)_N::size, (size_t)items());
memcpy(ret.data() + _N::size - s, payload().data(), s);
return ret;
}
@ -348,7 +348,7 @@ private:
for (unsigned i = 0; i < _N && !*d; ++i, --s, ++d) {}
if (s < 0x38)
m_out.push_back(s | 0x40);
m_out.push_back((byte)(s | 0x40));
else
pushCount(s, 0x40);
uint os = m_out.size();

19
libethereum/State.cpp

@ -20,9 +20,12 @@
*/
#include <secp256k1.h>
#pragma warning(push)
#pragma warning(disable:4244)
#include <sha.h>
#include <sha3.h>
#include <ripemd.h>
#pragma warning(pop)
#include <time.h>
#include <random>
#include "Trie.h"
@ -128,7 +131,9 @@ void State::sync(TransactionQueue& _tq)
// TRANSACTIONS
auto ts = _tq.transactions();
for (auto const& i: ts)
{
if (!m_transactions.count(i.first))
{
// don't have it yet! Execute it now.
try
{
@ -146,6 +151,8 @@ void State::sync(TransactionQueue& _tq)
// Something else went wrong - drop it.
_tq.drop(i.first);
}
}
}
}
u256 State::playback(bytesConstRef _block)
@ -686,9 +693,9 @@ void State::execute(Address _myAddress, Address _txSender, u256 _txValue, u256 _
bytes x = toBigEndian(stack.back());
stack.pop_back();
if (secp256k1_ecdsa_pubkey_verify(pub.data(), pub.size())) // TODO: Check both are less than P.
if (secp256k1_ecdsa_pubkey_verify(pub.data(), (int)pub.size())) // TODO: Check both are less than P.
{
secp256k1_ecdsa_pubkey_tweak_mul(pub.data(), pub.size(), x.data());
secp256k1_ecdsa_pubkey_tweak_mul(pub.data(), (int)pub.size(), x.data());
stack.push_back(fromBigEndian<u256>(bytesConstRef(&pub).cropped(1, 32)));
stack.push_back(fromBigEndian<u256>(bytesConstRef(&pub).cropped(33, 32)));
}
@ -716,9 +723,9 @@ void State::execute(Address _myAddress, Address _txSender, u256 _txValue, u256 _
stack.pop_back();
stack.pop_back();
if (secp256k1_ecdsa_pubkey_verify(pub.data(), pub.size()) && secp256k1_ecdsa_pubkey_verify(tweak.data(), tweak.size()))
if (secp256k1_ecdsa_pubkey_verify(pub.data(),(int) pub.size()) && secp256k1_ecdsa_pubkey_verify(tweak.data(),(int) tweak.size()))
{
secp256k1_ecdsa_pubkey_tweak_add(pub.data(), pub.size(), tweak.data());
secp256k1_ecdsa_pubkey_tweak_add(pub.data(), (int)pub.size(), tweak.data());
stack.push_back(fromBigEndian<u256>(bytesConstRef(&pub).cropped(1, 32)));
stack.push_back(fromBigEndian<u256>(bytesConstRef(&pub).cropped(33, 32)));
}
@ -763,7 +770,7 @@ void State::execute(Address _myAddress, Address _txSender, u256 _txValue, u256 _
byte pubkey[65];
int pubkeylen = 65;
if (secp256k1_ecdsa_recover_compact(msg.data(), msg.size(), sig.data(), pubkey, &pubkeylen, 0, v - 27))
if (secp256k1_ecdsa_recover_compact(msg.data(), (int)msg.size(), sig.data(), pubkey, &pubkeylen, 0, v - 27))
{
stack.push_back(0);
stack.push_back(0);
@ -784,7 +791,7 @@ void State::execute(Address _myAddress, Address _txSender, u256 _txValue, u256 _
stack.pop_back();
stack.pop_back();
stack.back() = secp256k1_ecdsa_pubkey_verify(pub.data(), pub.size()) ? 1 : 0;
stack.back() = secp256k1_ecdsa_pubkey_verify(pub.data(), (int)pub.size()) ? 1 : 0;
break;
}
case Instruction::SHA3:

2
libethereum/Transaction.cpp

@ -63,7 +63,7 @@ void Transaction::sign(PrivateKey _priv)
if (!secp256k1_ecdsa_sign_compact(msg.data(), 32, sig, _priv.data(), kFromMessage(msg, _priv).data(), &v))
throw InvalidSignature();
vrs.v = v + 27;
vrs.v = (byte)(v + 27);
vrs.r = fromBigEndian<u256>(bytesConstRef(sig, 32));
vrs.s = fromBigEndian<u256>(bytesConstRef(&(sig[32]), 32));
}

12
libethereum/Trie.cpp

@ -59,7 +59,7 @@ std::string hexPrefixEncode(bytes const& _hexVector, bool _terminated, int _begi
uint begin = _begin;
uint end = _end < 0 ? _hexVector.size() + 1 + _end : _end;
bool termed = _terminated;
bool odd = (end - begin) % 2;
bool odd = ((end - begin) % 2) != 0;
std::string ret(1, ((termed ? 2 : 0) | (odd ? 1 : 0)) * 16);
if (odd)
@ -101,7 +101,7 @@ void hash256rlp(HexMap const& _s, HexMap::const_iterator _begin, HexMap::const_i
uint c = 0;
for (auto i = std::next(_begin); i != _end && sharedPre; ++i, ++c)
{
uint x = std::min(sharedPre, std::min(_begin->first.size(), i->first.size()));
uint x = std::min(sharedPre, std::min((uint)_begin->first.size(), (uint)i->first.size()));
uint shared = _preLen;
for (; shared < x && _begin->first[shared] == i->first[shared]; ++shared) {}
sharedPre = std::min(shared, sharedPre);
@ -113,8 +113,8 @@ void hash256rlp(HexMap const& _s, HexMap::const_iterator _begin, HexMap::const_i
if (g_hashDebug)
std::cerr << s_indent << asHex(bytesConstRef(_begin->first.data() + _preLen, sharedPre), 1) << ": " << std::endl;
#endif
_rlp.appendList(2) << hexPrefixEncode(_begin->first, false, _preLen, sharedPre);
hash256aux(_s, _begin, _end, sharedPre, _rlp);
_rlp.appendList(2) << hexPrefixEncode(_begin->first, false, _preLen, (int)sharedPre);
hash256aux(_s, _begin, _end, (unsigned)sharedPre, _rlp);
#if ENABLE_DEBUG_PRINT
if (g_hashDebug)
std::cerr << s_indent << "= " << hex << sha3(_rlp.out()) << std::endl;
@ -517,7 +517,7 @@ byte TrieBranchNode::activeBranch() const
if (m_nodes[i] != nullptr)
{
if (n == (byte)-1)
n = i;
n = (byte)i;
else
return 16;
}
@ -535,7 +535,7 @@ TrieNode* TrieInfixNode::insert(bytesConstRef _key, std::string const& _value)
}
else
{
int prefix = commonPrefix(_key, m_ext);
uint prefix = commonPrefix(_key, m_ext);
if (prefix)
{
// one infix becomes two infixes, then insert into the second

1
libethereum/Trie.h

@ -22,7 +22,6 @@
#pragma once
#include <map>
#include <leveldb/db.h>
#include "RLP.h"
namespace ldb = leveldb;

2
libethereum/vector_ref.h

@ -39,7 +39,7 @@ public:
size_t size() const { return m_count; }
bool empty() const { return !m_count; }
vector_ref<_T> next() const { return vector_ref<_T>(m_data + m_count, m_count); }
vector_ref<_T> cropped(size_t _begin, int _count = -1) const { if (m_data && _begin + std::max(0, _count) <= m_count) return vector_ref<_T>(m_data + _begin, _count < 0 ? m_count - _begin : _count); else return vector_ref<_T>(); }
vector_ref<_T> cropped(size_t _begin, size_t _count = ~size_t(0)) const { if (m_data && _begin + std::max(size_t(0), _count) <= m_count) return vector_ref<_T>(m_data + _begin, _count == ~size_t(0) ? m_count - _begin : _count); else return vector_ref<_T>(); }
void retarget(_T const* _d, size_t _s) { m_data = _d; m_count = _s; }
void retarget(std::vector<_T> const& _t) { m_data = _t.data(); m_count = _t.size(); }

184
test/Test.vcxproj

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<Keyword>Win32Proj</Keyword>
<RootNamespace>Test</RootNamespace>
<ProjectName>Test</ProjectName>
<ProjectGuid>{3F3E389B-88DE-41D5-A73B-4F6036E18B36}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\libethereum\LibEthereum.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\libethereum\LibEthereum.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\libethereum\LibEthereum.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\libethereum\LibEthereum.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../libethereum</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../libethereum</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../libethereum</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StringPooling>true</StringPooling>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../libethereum</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StringPooling>true</StringPooling>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\cryptopp562\cryptlib.vcxproj">
<Project>{3423ec9a-52e4-4a4d-9753-edebc38785ef}</Project>
</ProjectReference>
<ProjectReference Include="..\libethereum\LibEthereum.vcxproj">
<Project>{7050c7cf-7551-48be-8e57-92235906c13a}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

6
test/main.cpp

@ -142,7 +142,7 @@ int main()
Trie t;
t.insert("dog", "puppy");
assert(t.hash256() == hash256({{"dog", "puppy"}}));
assert(t.hash256() == hash256(StringMap({{"dog", "puppy"}})));
assert(t.at("dog") == "puppy");
t.insert("doe", "reindeer");
assert(t.hash256() == hash256({{"dog", "puppy"}, {"doe", "reindeer"}}));
@ -158,7 +158,7 @@ int main()
assert(t.at("doe").empty());
assert(t.at("dogglesworth").empty());
assert(t.at("dog") == "puppy");
assert(t.hash256() == hash256({{"dog", "puppy"}}));
assert(t.hash256() == hash256(StringMap({{"dog", "puppy"}})));
t.insert("horse", "stallion");
t.insert("do", "verb");
t.insert("doge", "coin");
@ -170,7 +170,7 @@ int main()
t.remove("horse");
t.remove("do");
t.remove("doge");
assert(t.hash256() == hash256({{"dog", "puppy"}}));
assert(t.hash256() == hash256(StringMap({{"dog", "puppy"}})));
assert(t.at("dog") == "puppy");
t.remove("dog");

Loading…
Cancel
Save