aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Test.vcxproj16
-rw-r--r--crypto.cpp8
-rw-r--r--dagger.cpp10
-rw-r--r--main.cpp2
-rw-r--r--peer.cpp4
-rw-r--r--trie.cpp15
6 files changed, 32 insertions, 23 deletions
diff --git a/Test.vcxproj b/Test.vcxproj
index 8b08adad..74f88a03 100644
--- a/Test.vcxproj
+++ b/Test.vcxproj
@@ -92,7 +92,6 @@
<AdditionalIncludeDirectories>../libethereum</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
@@ -100,6 +99,7 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LargeAddressAware>true</LargeAddressAware>
+ <AdditionalLibraryDirectories>../../boost_1_55_0/stage/x86</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -111,13 +111,12 @@
<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>
+ <AdditionalLibraryDirectories>../../boost_1_55_0/stage/x64</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -132,7 +131,6 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StringPooling>true</StringPooling>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
@@ -142,6 +140,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LargeAddressAware>true</LargeAddressAware>
+ <AdditionalLibraryDirectories>../../boost_1_55_0/stage/x86</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -156,7 +155,6 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StringPooling>true</StringPooling>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
<OpenMPSupport>true</OpenMPSupport>
<DisableSpecificWarnings>4351</DisableSpecificWarnings>
</ClCompile>
@@ -165,6 +163,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
+ <AdditionalLibraryDirectories>../../boost_1_55_0/stage/x64</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@@ -176,7 +175,14 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="crypto.cpp" />
+ <ClCompile Include="dagger.cpp" />
+ <ClCompile Include="hexPrefix.cpp" />
<ClCompile Include="main.cpp" />
+ <ClCompile Include="peer.cpp" />
+ <ClCompile Include="rlp.cpp" />
+ <ClCompile Include="state.cpp" />
+ <ClCompile Include="trie.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/crypto.cpp b/crypto.cpp
index d01ccee0..3d565dd7 100644
--- a/crypto.cpp
+++ b/crypto.cpp
@@ -87,7 +87,7 @@ int cryptoTest()
ret = secp256k1_ecdsa_pubkey_create(pubkey.data(), &pubkeylen, privkey.data(), 1);
pubkey.resize(pubkeylen);
- int good = secp256k1_ecdsa_pubkey_verify(pubkey.data(), pubkey.size());
+ int good = secp256k1_ecdsa_pubkey_verify(pubkey.data(), (int)pubkey.size());
cout << "PUB: " << dec << ret << " " << pubkeylen << " " << asHex(pubkey) << (good ? " GOOD" : " BAD") << endl;
}
@@ -99,12 +99,12 @@ int cryptoTest()
cout << asHex(hmsg) << endl;
cout << asHex(privkey) << endl;
cout << hex << nonce << dec << endl;
- int ret = secp256k1_ecdsa_sign_compact((byte const*)hmsg.data(), hmsg.size(), sig.data(), privkey.data(), (byte const*)&nonce, &v);
+ int ret = secp256k1_ecdsa_sign_compact((byte const*)hmsg.data(), (int)hmsg.size(), sig.data(), privkey.data(), (byte const*)&nonce, &v);
cout << "MYSIG: " << dec << ret << " " << sig.size() << " " << asHex(sig) << " " << v << endl;
bytes pubkey(65);
int pubkeylen = 65;
- ret = secp256k1_ecdsa_recover_compact((byte const*)hmsg.data(), hmsg.size(), (byte const*)sig.data(), pubkey.data(), &pubkeylen, 0, v);
+ ret = secp256k1_ecdsa_recover_compact((byte const*)hmsg.data(), (int)hmsg.size(), (byte const*)sig.data(), pubkey.data(), &pubkeylen, 0, v);
pubkey.resize(pubkeylen);
cout << "MYREC: " << dec << ret << " " << pubkeylen << " " << asHex(pubkey) << endl;
}
@@ -112,7 +112,7 @@ int cryptoTest()
{
bytes pubkey(65);
int pubkeylen = 65;
- int ret = secp256k1_ecdsa_recover_compact((byte const*)hmsg.data(), hmsg.size(), (byte const*)sig64.data(), pubkey.data(), &pubkeylen, 0, (int)t.vrs.v - 27);
+ int ret = secp256k1_ecdsa_recover_compact((byte const*)hmsg.data(), (int)hmsg.size(), (byte const*)sig64.data(), pubkey.data(), &pubkeylen, 0, (int)t.vrs.v - 27);
pubkey.resize(pubkeylen);
cout << "RECPUB: " << dec << ret << " " << pubkeylen << " " << asHex(pubkey) << endl;
cout << "SENDER: " << hex << low160(eth::sha3(bytesConstRef(&pubkey).cropped(1))) << dec << endl;
diff --git a/dagger.cpp b/dagger.cpp
index ba2d143a..1a31f8a3 100644
--- a/dagger.cpp
+++ b/dagger.cpp
@@ -30,19 +30,17 @@ int daggerTest()
{
// Test dagger
{
- Dagger d;
auto s = steady_clock::now();
- cout << hex << d.eval((h256)1, (h256)0);
+ cout << hex << Dagger().eval((h256)1, (h256)0);
cout << " " << dec << duration_cast<milliseconds>(steady_clock::now() - s).count() << " ms" << endl;
- cout << hex << d.eval((h256)1, (h256)1);
+ cout << hex << Dagger().eval((h256)1, (h256)1);
cout << " " << dec << duration_cast<milliseconds>(steady_clock::now() - s).count() << " ms" << endl;
}
{
- Dagger d;
auto s = steady_clock::now();
- cout << hex << d.eval((h256)1, (h256)0);
+ cout << hex << Dagger().eval((h256)1, (h256)0);
cout << " " << dec << duration_cast<milliseconds>(steady_clock::now() - s).count() << " ms" << endl;
- cout << hex << d.eval((h256)1, (h256)1);
+ cout << hex << Dagger().eval((h256)1, (h256)1);
cout << " " << dec << duration_cast<milliseconds>(steady_clock::now() - s).count() << " ms" << endl;
}
return 0;
diff --git a/main.cpp b/main.cpp
index dc6faa2d..ed0ea76e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -34,7 +34,7 @@ int peerTest(int argc, char** argv);
#include <BlockInfo.h>
using namespace eth;
-int main(int argc, char** argv)
+int main(int, char**)
{
/* RLPStream s;
BlockInfo::genesis().fillStream(s, false);
diff --git a/peer.cpp b/peer.cpp
index 3f97b69d..6dfe363f 100644
--- a/peer.cpp
+++ b/peer.cpp
@@ -38,11 +38,11 @@ int peerTest(int argc, char** argv)
{
string arg = argv[i];
if (arg == "-l" && i + 1 < argc)
- listenPort = atoi(argv[++i]);
+ listenPort = (short)atoi(argv[++i]);
else if (arg == "-r" && i + 1 < argc)
remoteHost = argv[++i];
else if (arg == "-p" && i + 1 < argc)
- remotePort = atoi(argv[++i]);
+ remotePort = (short)atoi(argv[++i]);
else
remoteHost = argv[i];
}
diff --git a/trie.cpp b/trie.cpp
index 85416c2c..5cce3d0f 100644
--- a/trie.cpp
+++ b/trie.cpp
@@ -27,6 +27,11 @@
using namespace std;
using namespace eth;
+inline h256 stringMapHash256(StringMap const& _s)
+{
+ return hash256(_s);
+}
+
int trieTest()
{
{
@@ -42,13 +47,13 @@ int trieTest()
cout << t;
cout << m;
cout << t.root() << endl;
- cout << hash256({{"test", "test"}}) << endl;
+ cout << stringMapHash256({{"test", "test"}}) << endl;
t.insert(string("tesa"), string("testy"));
cout << t;
cout << m;
cout << t.root() << endl;
- cout << hash256({{"test", "test"}, {"te", "testy"}}) << endl;
+ cout << stringMapHash256({{"test", "test"}, {"te", "testy"}}) << endl;
cout << t.at(string("test")) << endl;
cout << t.at(string("te")) << endl;
cout << t.at(string("t")) << endl;
@@ -56,7 +61,7 @@ int trieTest()
t.remove(string("te"));
cout << m;
cout << t.root() << endl;
- cout << hash256({{"test", "test"}}) << endl;
+ cout << stringMapHash256({{"test", "test"}}) << endl;
t.remove(string("test"));
cout << m;
@@ -72,7 +77,7 @@ int trieTest()
cout << t;
cout << m;
cout << t.root() << endl;
- cout << hash256({{"b", "B"}, {"a", "A"}}) << endl;
+ cout << stringMapHash256({{"b", "B"}, {"a", "A"}}) << endl;
cout << RLP(rlp256({{"b", "B"}, {"a", "A"}})) << endl;
}
{
@@ -89,7 +94,7 @@ int trieTest()
cout << RLP(t.rlp()) << endl;
}
{
- cout << hex << hash256({{"dog", "puppy"}, {"doe", "reindeer"}}) << endl;
+ cout << hex << stringMapHash256({{"dog", "puppy"}, {"doe", "reindeer"}}) << endl;
MemTrie t;
t.insert("dog", "puppy");
t.insert("doe", "reindeer");