aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-04-06 03:08:22 +0800
committerGav Wood <i@gavwood.com>2015-04-06 03:08:22 +0800
commit0dc70c63a9009aa5ccf2da99893a426a1d6db6d5 (patch)
treee2acdd90da4b8983ed2bcbcb802adc5a3eb350b0 /TestHelper.cpp
parent966407f28555d46bddfd76287198615ac1f5cc9b (diff)
downloaddexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar
dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.gz
dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.bz2
dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.lz
dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.xz
dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.zst
dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.zip
Move hash to a hidden function, and provide a datapath to it so avoid
unneeded SHA3s.
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r--TestHelper.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index 295b759f..140efdb9 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -70,7 +70,10 @@ namespace test
struct ValueTooLarge: virtual Exception {};
bigint const c_max256plus1 = bigint(1) << 256;
-ImportTest::ImportTest(json_spirit::mObject& _o, bool isFiller) : m_statePre(Address(_o["env"].get_obj()["currentCoinbase"].get_str()), OverlayDB(), eth::BaseState::Empty), m_statePost(Address(_o["env"].get_obj()["currentCoinbase"].get_str()), OverlayDB(), eth::BaseState::Empty), m_TestObject(_o)
+ImportTest::ImportTest(json_spirit::mObject& _o, bool isFiller):
+ m_statePre(OverlayDB(), eth::BaseState::Empty, Address(_o["env"].get_obj()["currentCoinbase"].get_str())),
+ m_statePost(OverlayDB(), eth::BaseState::Empty, Address(_o["env"].get_obj()["currentCoinbase"].get_str())),
+ m_TestObject(_o)
{
importEnv(_o["env"].get_obj());
importState(_o["pre"].get_obj(), m_statePre);
@@ -92,7 +95,7 @@ void ImportTest::importEnv(json_spirit::mObject& _o)
assert(_o.count("currentCoinbase") > 0);
assert(_o.count("currentNumber") > 0);
- m_environment.previousBlock.hash = h256(_o["previousHash"].get_str());
+ m_environment.currentBlock.parentHash = h256(_o["parentHash"].get_str());
m_environment.currentBlock.number = toInt(_o["currentNumber"]);
m_environment.currentBlock.gasLimit = toInt(_o["currentGasLimit"]);
m_environment.currentBlock.difficulty = toInt(_o["currentDifficulty"]);