aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.cpp
diff options
context:
space:
mode:
authorwinsvega <winsvega@mail.ru>2015-01-23 20:28:04 +0800
committerwinsvega <winsvega@mail.ru>2015-01-23 20:28:04 +0800
commit34249753e8fae8baa4ccd87e16df46c42ef4d4b2 (patch)
treef2051b4c9ca2f9c08dd3ae9efdb08f015e66bc1d /TestHelper.cpp
parent0f7b1b33445ebc61b295da4fa0722c66158dc0d3 (diff)
parentfd773be884d945682f633fe70e61498f38663668 (diff)
downloaddexon-solidity-34249753e8fae8baa4ccd87e16df46c42ef4d4b2.tar.gz
dexon-solidity-34249753e8fae8baa4ccd87e16df46c42ef4d4b2.tar.zst
dexon-solidity-34249753e8fae8baa4ccd87e16df46c42ef4d4b2.zip
Merge remote-tracking branch 'ethereum/develop' into develop
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r--TestHelper.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index 1b854162..8c7345df 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -115,7 +115,7 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state)
if (code.size())
{
_state.m_cache[address] = Account(toInt(o["balance"]), Account::ContractConception);
- _state.m_cache[address].setCode(bytesConstRef(&code));
+ _state.m_cache[address].setCode(code);
}
else
_state.m_cache[address] = Account(toInt(o["balance"]), Account::NormalCreation);
@@ -357,6 +357,19 @@ void checkLog(LogEntries _resultLogs, LogEntries _expectedLogs)
}
}
+void checkCallCreates(eth::Transactions _resultCallCreates, eth::Transactions _expectedCallCreates)
+{
+ BOOST_REQUIRE_EQUAL(_resultCallCreates.size(), _expectedCallCreates.size());
+
+ for (size_t i = 0; i < _resultCallCreates.size(); ++i)
+ {
+ BOOST_CHECK(_resultCallCreates[i].data() == _expectedCallCreates[i].data());
+ BOOST_CHECK(_resultCallCreates[i].receiveAddress() == _expectedCallCreates[i].receiveAddress());
+ BOOST_CHECK(_resultCallCreates[i].gas() == _expectedCallCreates[i].gas());
+ BOOST_CHECK(_resultCallCreates[i].value() == _expectedCallCreates[i].value());
+ }
+}
+
std::string getTestPath()
{
string testPath;
@@ -496,4 +509,12 @@ void processCommandLineOptions()
}
}
+LastHashes lastHashes(u256 _currentBlockNumber)
+{
+ LastHashes ret;
+ for (u256 i = 1; i <= 256 && i <= _currentBlockNumber; ++i)
+ ret.push_back(sha3(toString(_currentBlockNumber - i)));
+ return ret;
+}
+
} } // namespaces