mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Work in progress on Visual Studio 2013 compile fixes. Libethereum compiles again but not sorted out linking dependencies yet.
This commit is contained in:
parent
8aeece1eb5
commit
7a1f75ddbf
16
Test.vcxproj
16
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">
|
||||
|
@ -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;
|
||||
|
10
dagger.cpp
10
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;
|
||||
|
2
main.cpp
2
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);
|
||||
|
4
peer.cpp
4
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];
|
||||
}
|
||||
|
15
trie.cpp
15
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");
|
||||
|
Loading…
Reference in New Issue
Block a user