aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-06 01:49:58 +0800
committerChristian <c@ethdev.com>2014-11-06 01:50:23 +0800
commit693bc9027513f83a148df1a2c2da089a6b5e4ffd (patch)
treee45fc5bc8630c13c332d191d67e81269ddc7de1a
parent849ccb41596ac77b429e8e33a98335cf59dfbbfa (diff)
downloaddexon-solidity-693bc9027513f83a148df1a2c2da089a6b5e4ffd.tar.gz
dexon-solidity-693bc9027513f83a148df1a2c2da089a6b5e4ffd.tar.zst
dexon-solidity-693bc9027513f83a148df1a2c2da089a6b5e4ffd.zip
Further framework fix.
-rw-r--r--solidityEndToEndTest.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/solidityEndToEndTest.cpp b/solidityEndToEndTest.cpp
index 5aeaf3e6..b28b8499 100644
--- a/solidityEndToEndTest.cpp
+++ b/solidityEndToEndTest.cpp
@@ -39,14 +39,12 @@ namespace test
class ExecutionFramework
{
public:
- ExecutionFramework(): m_executive(m_state) { g_logVerbosity = 0; }
+ ExecutionFramework() { g_logVerbosity = 0; }
bytes compileAndRun(std::string const& _sourceCode)
{
bytes code = dev::solidity::CompilerStack::compile(_sourceCode);
sendMessage(code, true);
- m_contractAddress = m_executive.newAddress();
- BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress));
return m_output;
}
@@ -65,27 +63,31 @@ public:
private:
void sendMessage(bytes const& _data, bool _isCreation)
{
+ eth::Executive executive(m_state);
eth::Transaction t = _isCreation ? eth::Transaction(0, m_gasPrice, m_gas, _data)
: eth::Transaction(0, m_gasPrice, m_gas, m_contractAddress, _data);
bytes transactionRLP = t.rlp();
try
{
// this will throw since the transaction is invalid, but it should nevertheless store the transaction
- m_executive.setup(&transactionRLP);
+ executive.setup(&transactionRLP);
}
catch (...) {}
if (_isCreation)
- BOOST_REQUIRE(!m_executive.create(Address(), 0, m_gasPrice, m_gas, &_data, Address()));
+ {
+ BOOST_REQUIRE(!executive.create(Address(), 0, m_gasPrice, m_gas, &_data, Address()));
+ m_contractAddress = executive.newAddress();
+ BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress));
+ }
else
- BOOST_REQUIRE(!m_executive.call(m_contractAddress, Address(), 0, m_gasPrice, &_data, m_gas, Address()));
- BOOST_REQUIRE(m_executive.go());
- m_executive.finalize();
- m_output = m_executive.out().toBytes();
+ BOOST_REQUIRE(!executive.call(m_contractAddress, Address(), 0, m_gasPrice, &_data, m_gas, Address()));
+ BOOST_REQUIRE(executive.go());
+ executive.finalize();
+ m_output = executive.out().toBytes();
}
Address m_contractAddress;
eth::State m_state;
- eth::Executive m_executive;
u256 const m_gasPrice = 100 * eth::szabo;
u256 const m_gas = 1000000;
bytes m_output;