aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2014-12-13 04:09:49 +0800
committerCJentzsch <jentzsch.software@gmail.com>2014-12-13 04:09:49 +0800
commitfbcd86f4849faea3b13365f26c12839a514f985d (patch)
treea593d468d3fcaf27388cac34113331a09818f843
parent3a9837f7f25af435f77762be1d24690132ffe8d6 (diff)
parentfe21a5c67e77771ed43cb7ef58de1d3b9a9ce8cb (diff)
downloaddexon-solidity-fbcd86f4849faea3b13365f26c12839a514f985d.tar
dexon-solidity-fbcd86f4849faea3b13365f26c12839a514f985d.tar.gz
dexon-solidity-fbcd86f4849faea3b13365f26c12839a514f985d.tar.bz2
dexon-solidity-fbcd86f4849faea3b13365f26c12839a514f985d.tar.lz
dexon-solidity-fbcd86f4849faea3b13365f26c12839a514f985d.tar.xz
dexon-solidity-fbcd86f4849faea3b13365f26c12839a514f985d.tar.zst
dexon-solidity-fbcd86f4849faea3b13365f26c12839a514f985d.zip
Merge remote-tracking branch 'upstream/develop' into fixTest
-rw-r--r--TestHelper.cpp4
-rw-r--r--jsonrpc.cpp2
-rw-r--r--solidityExecutionFramework.h4
-rw-r--r--state.cpp2
-rw-r--r--trie.cpp3
-rw-r--r--vm.cpp8
-rw-r--r--vm.h4
-rw-r--r--whisperTopic.cpp5
8 files changed, 19 insertions, 13 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index ea0bf341..ff8a0d40 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -329,6 +329,10 @@ void checkStorage(map<u256, u256> _expectedStore, map<u256, u256> _resultStore,
BOOST_CHECK_MESSAGE(expectedStoreValue == resultStoreValue, _expectedAddr << ": store[" << expectedStoreKey << "] = " << resultStoreValue << ", expected " << expectedStoreValue);
}
}
+
+ for (auto&& resultStorePair : _resultStore)
+ if (!_expectedStore.count(resultStorePair.first))
+ BOOST_ERROR(_expectedAddr << ": unexpected store key " << resultStorePair.first);
}
void checkLog(LogEntries _resultLogs, LogEntries _expectedLogs)
diff --git a/jsonrpc.cpp b/jsonrpc.cpp
index 20ffc6d5..970957b5 100644
--- a/jsonrpc.cpp
+++ b/jsonrpc.cpp
@@ -43,7 +43,7 @@ using namespace dev;
using namespace dev::eth;
namespace js = json_spirit;
-WebThreeDirect *web3;
+WebThreeDirect* web3;
unique_ptr<WebThreeStubServer> jsonrpcServer;
unique_ptr<WebThreeStubClient> jsonrpcClient;
diff --git a/solidityExecutionFramework.h b/solidityExecutionFramework.h
index 9d40e8a4..91ee7ad6 100644
--- a/solidityExecutionFramework.h
+++ b/solidityExecutionFramework.h
@@ -117,7 +117,7 @@ private:
void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0)
{
m_state.addBalance(m_sender, _value); // just in case
- eth::Executive executive(m_state);
+ eth::Executive executive(m_state, 0);
eth::Transaction t = _isCreation ? eth::Transaction(_value, m_gasPrice, m_gas, _data, 0, KeyPair::create().sec())
: eth::Transaction(_value, m_gasPrice, m_gas, m_contractAddress, _data, 0, KeyPair::create().sec());
bytes transactionRLP = t.rlp();
@@ -137,7 +137,7 @@ private:
else
{
BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress));
- BOOST_REQUIRE(!executive.call(m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender));
+ BOOST_REQUIRE(!executive.call(m_contractAddress, m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender));
}
BOOST_REQUIRE(executive.go());
m_state.noteSending(m_sender);
diff --git a/state.cpp b/state.cpp
index 07c8373e..3fe0fe30 100644
--- a/state.cpp
+++ b/state.cpp
@@ -45,7 +45,7 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
{
for (auto& i: v.get_obj())
{
- cnote << i.first;
+ cerr << i.first << endl;
mObject& o = i.second.get_obj();
BOOST_REQUIRE(o.count("env") > 0);
diff --git a/trie.cpp b/trie.cpp
index 6c9f6877..2141d5de 100644
--- a/trie.cpp
+++ b/trie.cpp
@@ -54,7 +54,6 @@ BOOST_AUTO_TEST_CASE(trie_test_anyorder)
{
string testPath = test::getTestPath();
-
testPath += "/TrieTests";
cnote << "Testing Trie...";
@@ -289,6 +288,7 @@ BOOST_AUTO_TEST_CASE(moreTrieTests)
BOOST_AUTO_TEST_CASE(trieLowerBound)
{
cnote << "Stress-testing Trie.lower_bound...";
+ if (0)
{
MemoryDB dm;
EnforceRefs e(dm, true);
@@ -334,6 +334,7 @@ BOOST_AUTO_TEST_CASE(trieLowerBound)
BOOST_AUTO_TEST_CASE(trieStess)
{
cnote << "Stress-testing Trie...";
+ if (0)
{
MemoryDB m;
MemoryDB dm;
diff --git a/vm.cpp b/vm.cpp
index d8e85383..f05981d9 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -34,18 +34,18 @@ using namespace dev::test;
FakeExtVM::FakeExtVM(eth::BlockInfo const& _previousBlock, eth::BlockInfo const& _currentBlock, unsigned _depth): /// TODO: XXX: remove the default argument & fix.
ExtVMFace(Address(), Address(), Address(), 0, 1, bytesConstRef(), bytes(), _previousBlock, _currentBlock, _depth) {}
-h160 FakeExtVM::create(u256 _endowment, u256* _gas, bytesConstRef _init, OnOpFunc const&)
+h160 FakeExtVM::create(u256 _endowment, u256& io_gas, bytesConstRef _init, OnOpFunc const&)
{
Address na = right160(sha3(rlpList(myAddress, get<1>(addresses[myAddress]))));
- Transaction t(_endowment, gasPrice, *_gas, _init.toBytes());
+ Transaction t(_endowment, gasPrice, io_gas, _init.toBytes());
callcreates.push_back(t);
return na;
}
-bool FakeExtVM::call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256* _gas, bytesRef _out, OnOpFunc const&, Address _myAddressOverride, Address _codeAddressOverride)
+bool FakeExtVM::call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256& io_gas, bytesRef _out, OnOpFunc const&, Address _myAddressOverride, Address _codeAddressOverride)
{
- Transaction t(_value, gasPrice, *_gas, _receiveAddress, _data.toVector());
+ Transaction t(_value, gasPrice, io_gas, _receiveAddress, _data.toVector());
callcreates.push_back(t);
(void)_out;
(void)_myAddressOverride;
diff --git a/vm.h b/vm.h
index 3d4b88d5..ff948cbf 100644
--- a/vm.h
+++ b/vm.h
@@ -55,8 +55,8 @@ public:
virtual u256 txCount(Address _a) override { return std::get<1>(addresses[_a]); }
virtual void suicide(Address _a) override { std::get<0>(addresses[_a]) += std::get<0>(addresses[myAddress]); addresses.erase(myAddress); }
virtual bytes const& codeAt(Address _a) override { return std::get<3>(addresses[_a]); }
- virtual h160 create(u256 _endowment, u256* _gas, bytesConstRef _init, eth::OnOpFunc const&) override;
- virtual bool call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256* _gas, bytesRef _out, eth::OnOpFunc const&, Address, Address) override;
+ virtual h160 create(u256 _endowment, u256& io_gas, bytesConstRef _init, eth::OnOpFunc const&) override;
+ virtual bool call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256& io_gas, bytesRef _out, eth::OnOpFunc const&, Address, Address) override;
void setTransaction(Address _caller, u256 _value, u256 _gasPrice, bytes const& _data);
void setContract(Address _myAddress, u256 _myBalance, u256 _myNonce, std::map<u256, u256> const& _storage, bytes const& _code);
void set(Address _a, u256 _myBalance, u256 _myNonce, std::map<u256, u256> const& _storage, bytes const& _code);
diff --git a/whisperTopic.cpp b/whisperTopic.cpp
index c5e59332..79adf3d6 100644
--- a/whisperTopic.cpp
+++ b/whisperTopic.cpp
@@ -33,7 +33,8 @@ BOOST_AUTO_TEST_SUITE(whisper)
BOOST_AUTO_TEST_CASE(topic)
{
cnote << "Testing Whisper...";
-// g_logVerbosity = 0;
+ auto oldLogVerbosity = g_logVerbosity;
+ g_logVerbosity = 0;
bool started = false;
unsigned result = 0;
@@ -81,7 +82,7 @@ BOOST_AUTO_TEST_CASE(topic)
}
listener.join();
-// g_logVerbosity = 0;
+ g_logVerbosity = oldLogVerbosity;
BOOST_REQUIRE_EQUAL(result, 1 + 9 + 25 + 49 + 81);
}