aboutsummaryrefslogtreecommitdiffstats
path: root/createRandomTest.cpp
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2014-12-05 21:39:24 +0800
committerPaweł Bylica <pawel.bylica@imapp.pl>2014-12-05 21:39:24 +0800
commit421b5ccc362cf145cd214985240fa2a0848cd026 (patch)
treea6d95e5f0e263f32935dbd900d70d9233d2017cb /createRandomTest.cpp
parent20b6b30b999447e7770b062bf71741d2ba88d1fb (diff)
downloaddexon-solidity-421b5ccc362cf145cd214985240fa2a0848cd026.tar.gz
dexon-solidity-421b5ccc362cf145cd214985240fa2a0848cd026.tar.zst
dexon-solidity-421b5ccc362cf145cd214985240fa2a0848cd026.zip
Fix random test generator
Diffstat (limited to 'createRandomTest.cpp')
-rw-r--r--createRandomTest.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/createRandomTest.cpp b/createRandomTest.cpp
index 1647ce81..a01eec65 100644
--- a/createRandomTest.cpp
+++ b/createRandomTest.cpp
@@ -1,18 +1,18 @@
/*
- This file is part of cpp-ethereum.
+ This file is part of cpp-ethereum.
- cpp-ethereum is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- cpp-ethereum is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file createRandomTest.cpp
* @author Christoph Jentzsch <jentzsch.simulationsoftware@gmail.com>
@@ -31,6 +31,7 @@
#include <json_spirit/json_spirit_writer_template.h>
#include <libdevcore/CommonIO.h>
#include <libdevcore/CommonData.h>
+#include <libethereum/VMFactory.h>
#include <libevmcore/Instruction.h>
#include <libevm/VM.h>
#include "vm.h"
@@ -128,6 +129,9 @@ void doMyTests(json_spirit::mValue& v)
assert(o.count("pre") > 0);
assert(o.count("exec") > 0);
+
+ auto vmObj = eth::VMFactory::create(eth::VMFactory::Interpreter);
+ auto& vm = *vmObj;
dev::test::FakeExtVM fev;
fev.importEnv(o["env"].get_obj());
fev.importState(o["pre"].get_obj());
@@ -141,9 +145,8 @@ void doMyTests(json_spirit::mValue& v)
fev.code = fev.thisTxCode;
}
+ vm.reset(fev.gas);
bytes output;
- eth::VM vm(fev.gas);
-
u256 gas;
bool vmExceptionOccured = false;
try