aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaweł Bylica <chfast@gmail.com>2014-12-11 00:41:53 +0800
committerPaweł Bylica <chfast@gmail.com>2014-12-11 00:41:53 +0800
commitc1ffbbe79729b25da0d0231cd81fe2ab60519448 (patch)
tree138e5c52644d0e27959f04d5ca6e32451aceb852
parenteafe303e083a77216c6ef4a96a99d50c9718dae8 (diff)
downloaddexon-solidity-c1ffbbe79729b25da0d0231cd81fe2ab60519448.tar.gz
dexon-solidity-c1ffbbe79729b25da0d0231cd81fe2ab60519448.tar.zst
dexon-solidity-c1ffbbe79729b25da0d0231cd81fe2ab60519448.zip
VMFactory - a new way of creating VMs
-rw-r--r--createRandomTest.cpp8
-rw-r--r--vm.cpp7
2 files changed, 8 insertions, 7 deletions
diff --git a/createRandomTest.cpp b/createRandomTest.cpp
index caeeb6b6..a1168845 100644
--- a/createRandomTest.cpp
+++ b/createRandomTest.cpp
@@ -32,7 +32,7 @@
#include <libdevcore/CommonIO.h>
#include <libdevcore/CommonData.h>
#include <libevmcore/Instruction.h>
-#include <libevm/VM.h>
+#include <libevm/VMFactory.h>
#include "vm.h"
using namespace std;
@@ -142,14 +142,14 @@ void doMyTests(json_spirit::mValue& v)
}
bytes output;
- eth::VM vm(fev.gas);
+ auto vm = eth::VMFactory::create(fev.gas);
u256 gas;
bool vmExceptionOccured = false;
try
{
- output = vm.go(fev, fev.simpleTrace()).toBytes();
- gas = vm.gas();
+ output = vm->go(fev, fev.simpleTrace()).toBytes();
+ gas = vm->gas();
}
catch (eth::VMException const& _e)
{
diff --git a/vm.cpp b/vm.cpp
index 45034b71..02cee0a0 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -22,6 +22,7 @@
#include <boost/filesystem.hpp>
#include <libethereum/Executive.h>
+#include <libevm/VMFactory.h>
#include "vm.h"
using namespace std;
@@ -298,14 +299,14 @@ void doVMTests(json_spirit::mValue& v, bool _fillin)
}
bytes output;
- VM vm(fev.gas);
+ auto vm = eth::VMFactory::create(fev.gas);
u256 gas;
bool vmExceptionOccured = false;
try
{
- output = vm.go(fev, fev.simpleTrace()).toBytes();
- gas = vm.gas();
+ output = vm->go(fev, fev.simpleTrace()).toBytes();
+ gas = vm->gas();
}
catch (VMException const& _e)
{