aboutsummaryrefslogtreecommitdiffstats
path: root/vm.cpp
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2014-10-29 17:21:59 +0800
committerPaweł Bylica <pawel.bylica@imapp.pl>2014-10-29 17:23:17 +0800
commitf73a461e13b1d8f88e93b57c66933549bb855b8c (patch)
tree91478df25e4ba31979d05ba3a66c90a26158537d /vm.cpp
parent878c41b3e3448b8f24da1427e6f575a0995e1704 (diff)
downloaddexon-solidity-f73a461e13b1d8f88e93b57c66933549bb855b8c.tar.gz
dexon-solidity-f73a461e13b1d8f88e93b57c66933549bb855b8c.tar.zst
dexon-solidity-f73a461e13b1d8f88e93b57c66933549bb855b8c.zip
Expose VM kind setting of State in FakeExtVM
This reverts commit 6ad065bb3e30b5e67283f70e84ac55368e843e6a.
Diffstat (limited to 'vm.cpp')
-rw-r--r--vm.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/vm.cpp b/vm.cpp
index d03a4a27..a8e1ea72 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -441,8 +441,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;
@@ -500,7 +500,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());
@@ -513,14 +520,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