diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-07-14 00:24:51 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-07-14 00:40:55 +0800 |
commit | d5683e5e2edfc43732e418382df5b26ad4feb79c (patch) | |
tree | 16ea362f93a4371b63310d62486c6bc9880ebf26 /TestHelper.cpp | |
parent | 298fc41f6a4648544620adf87572f851bd436638 (diff) | |
parent | 614a2a32e30618fadc0232c401b1a3f1ff851285 (diff) | |
download | dexon-solidity-d5683e5e2edfc43732e418382df5b26ad4feb79c.tar dexon-solidity-d5683e5e2edfc43732e418382df5b26ad4feb79c.tar.gz dexon-solidity-d5683e5e2edfc43732e418382df5b26ad4feb79c.tar.bz2 dexon-solidity-d5683e5e2edfc43732e418382df5b26ad4feb79c.tar.lz dexon-solidity-d5683e5e2edfc43732e418382df5b26ad4feb79c.tar.xz dexon-solidity-d5683e5e2edfc43732e418382df5b26ad4feb79c.tar.zst dexon-solidity-d5683e5e2edfc43732e418382df5b26ad4feb79c.zip |
Merge branch 'develop' into client_ref
Conflicts:
libethereum/Client.cpp
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r-- | TestHelper.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp index 698f3512..9a1b1693 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -199,10 +199,10 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state, stateOptio stateOptions.m_bHasCode = true; } - if (code.size()) + if (!code.empty()) { _state.m_cache[address] = Account(balance, Account::ContractConception); - _state.m_cache[address].setCode(code); + _state.m_cache[address].setCode(std::move(code)); } else _state.m_cache[address] = Account(balance, Account::NormalCreation); @@ -235,7 +235,7 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state) } void ImportTest::importTransaction(json_spirit::mObject& _o) -{ +{ if (_o.count("secretKey") > 0) { assert(_o.count("nonce") > 0); @@ -728,10 +728,20 @@ Options::Options() for (auto i = 0; i < argc; ++i) { auto arg = std::string{argv[i]}; - if (arg == "--jit") - eth::VMFactory::setKind(eth::VMKind::JIT); - else if (arg == "--vm=smart") - eth::VMFactory::setKind(eth::VMKind::Smart); + if (arg == "--vm" && i + 1 < argc) + { + string vmKind = argv[++i]; + if (vmKind == "interpreter") + VMFactory::setKind(VMKind::Interpreter); + else if (vmKind == "jit") + VMFactory::setKind(VMKind::JIT); + else if (vmKind == "smart") + VMFactory::setKind(VMKind::Smart); + else + cerr << "Unknown VM kind: " << vmKind << endl; + } + else if (arg == "--jit") // TODO: Remove deprecated option "--jit" + VMFactory::setKind(VMKind::JIT); else if (arg == "--vmtrace") vmtrace = true; else if (arg == "--filltests") |