diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-11-18 18:46:38 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-11-18 18:46:38 +0800 |
commit | 1d278d28575866f9d001fea75776fbd61cb2e3ce (patch) | |
tree | dac09adb7015173583560f1957df5d5457d008a1 /createRandomTest.cpp | |
parent | 51a0ca457fa5495d9e4fda387c9f5d3f776a56c4 (diff) | |
parent | 09be38b0c1a7283bae8e84fe41aba8a2b916a608 (diff) | |
download | dexon-solidity-1d278d28575866f9d001fea75776fbd61cb2e3ce.tar dexon-solidity-1d278d28575866f9d001fea75776fbd61cb2e3ce.tar.gz dexon-solidity-1d278d28575866f9d001fea75776fbd61cb2e3ce.tar.bz2 dexon-solidity-1d278d28575866f9d001fea75776fbd61cb2e3ce.tar.lz dexon-solidity-1d278d28575866f9d001fea75776fbd61cb2e3ce.tar.xz dexon-solidity-1d278d28575866f9d001fea75776fbd61cb2e3ce.tar.zst dexon-solidity-1d278d28575866f9d001fea75776fbd61cb2e3ce.zip |
Merge branch 'develop' into mk_jsonrpc_upgrade
Conflicts:
alethzero/MainWin.cpp
libweb3jsonrpc/WebThreeStubServer.cpp
libweb3jsonrpc/abstractwebthreestubserver.h
libweb3jsonrpc/spec.json
test/jsonrpc.cpp
test/webthreestubclient.h
Diffstat (limited to 'createRandomTest.cpp')
-rw-r--r-- | createRandomTest.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/createRandomTest.cpp b/createRandomTest.cpp index 28e4342d..60a2039c 100644 --- a/createRandomTest.cpp +++ b/createRandomTest.cpp @@ -31,7 +31,8 @@ #include <json_spirit/json_spirit_writer_template.h> #include <libdevcore/CommonIO.h> #include <libdevcore/CommonData.h> -#include <libevmface/Instruction.h> +#include <libevmcore/Instruction.h> +#include <libevm/VM.h> #include "vm.h" using namespace std; @@ -134,18 +135,24 @@ void doMyTests(json_spirit::mValue& v) o["pre"] = mValue(fev.exportState()); fev.importExec(o["exec"].get_obj()); - if (!fev.code) + if (fev.code.empty()) { fev.thisTxCode = get<3>(fev.addresses.at(fev.myAddress)); - fev.code = &fev.thisTxCode; + fev.code = fev.thisTxCode; } vm.reset(fev.gas); bytes output; + u256 gas; try { output = vm.go(fev).toBytes(); } + catch (eth::VMException const& _e) + { + cnote << "VM did throw an exception: " << diagnostic_information(_e); + gas = 0; + } catch (Exception const& _e) { cnote << "VM did throw an exception: " << diagnostic_information(_e); @@ -176,6 +183,6 @@ void doMyTests(json_spirit::mValue& v) o["post"] = mValue(fev.exportState()); o["callcreates"] = fev.exportCallCreates(); o["out"] = "0x" + toHex(output); - fev.push(o, "gas", vm.gas()); + fev.push(o, "gas", gas); } } |