diff options
author | Paweł Bylica <pawel.bylica@imapp.pl> | 2014-10-23 21:28:08 +0800 |
---|---|---|
committer | Paweł Bylica <pawel.bylica@imapp.pl> | 2014-10-23 21:28:08 +0800 |
commit | 6cc1cb1001eaea1e462c6b62d763b6f8504dda77 (patch) | |
tree | 1833cd9f288cc2d7ffa80d72776a1fd9186c16c6 /vm.cpp | |
parent | 7b7d991954f9f567e1f8b36447e9a4ed851335ce (diff) | |
download | dexon-solidity-6cc1cb1001eaea1e462c6b62d763b6f8504dda77.tar dexon-solidity-6cc1cb1001eaea1e462c6b62d763b6f8504dda77.tar.gz dexon-solidity-6cc1cb1001eaea1e462c6b62d763b6f8504dda77.tar.bz2 dexon-solidity-6cc1cb1001eaea1e462c6b62d763b6f8504dda77.tar.lz dexon-solidity-6cc1cb1001eaea1e462c6b62d763b6f8504dda77.tar.xz dexon-solidity-6cc1cb1001eaea1e462c6b62d763b6f8504dda77.tar.zst dexon-solidity-6cc1cb1001eaea1e462c6b62d763b6f8504dda77.zip |
Expose VM kind setting of State in FakeExtVM
Diffstat (limited to 'vm.cpp')
-rw-r--r-- | vm.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -436,8 +436,8 @@ h160 FakeState::createNewAddress(Address _newAddress, Address _sender, u256 _end m_cache[_newAddress] = AddressState(0, balance(_newAddress) + _endowment, h256(), h256()); // Execute init code. - auto vmObj = VMFace::create(VMFace::Interpreter, *_gas); - VMFace& vm = *vmObj; + auto vmObj = VMFace::create(getVMKind(), *_gas); + auto& vm = *vmObj; ExtVM evm(*this, _newAddress, _sender, _origin, _endowment, _gasPrice, bytesConstRef(), _code, o_ms, _level); bool revert = false; bytesConstRef out; @@ -499,7 +499,14 @@ void doTests(json_spirit::mValue& v, bool _fillin) BOOST_REQUIRE(o.count("pre") > 0); BOOST_REQUIRE(o.count("exec") > 0); + auto argc = boost::unit_test::framework::master_test_suite().argc; + auto argv = boost::unit_test::framework::master_test_suite().argv; + auto useJit = argc >= 2 && std::string(argv[1]) == "--jit"; + auto vmKind = useJit ? VMFace::JIT : VMFace::Interpreter; + dev::test::FakeExtVM fev; + fev.setVMKind(vmKind); + fev.importEnv(o["env"].get_obj()); fev.importState(o["pre"].get_obj()); @@ -512,14 +519,8 @@ void doTests(json_spirit::mValue& v, bool _fillin) fev.thisTxCode = get<3>(fev.addresses.at(fev.myAddress)); fev.code = &fev.thisTxCode; } - - - auto argc = boost::unit_test::framework::master_test_suite().argc; - auto argv = boost::unit_test::framework::master_test_suite().argv; - auto useJit = argc >= 2 && std::string(argv[1]) == "--jit"; - auto vmKind = useJit ? VMFace::JIT : VMFace::Interpreter; - auto vm = VMFace::create(vmKind, fev.gas); + auto vm = VMFace::create(fev.getVMKind(), fev.gas); bytes output; auto outOfGas = false; try |