aboutsummaryrefslogtreecommitdiffstats
path: root/vm.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm.h')
-rw-r--r--vm.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/vm.h b/vm.h
index 5bad9d7d..34e0e855 100644
--- a/vm.h
+++ b/vm.h
@@ -40,11 +40,18 @@ namespace dev { namespace test {
struct FakeExtVMFailure : virtual Exception {};
+class FakeState: public eth::State
+{
+public:
+ /// Execute a contract-creation transaction.
+ h160 createNewAddress(Address _newAddress, Address _txSender, u256 _endowment, u256 _gasPrice, u256* _gas, bytesConstRef _code, Address _originAddress = Address(), std::set<Address>* o_suicides = nullptr, eth::Manifest* o_ms = nullptr, eth::OnOpFunc const& _onOp = eth::OnOpFunc(), unsigned _level = 0);
+};
+
class FakeExtVM: public eth::ExtVMFace
{
public:
FakeExtVM() {}
- FakeExtVM(eth::BlockInfo const& _previousBlock, eth::BlockInfo const& _currentBlock);
+ FakeExtVM(eth::BlockInfo const& _previousBlock, eth::BlockInfo const& _currentBlock, unsigned _depth = 0);
u256 store(u256 _n) { return std::get<2>(addresses[myAddress])[_n]; }
void setStore(u256 _n, u256 _v) { std::get<2>(addresses[myAddress])[_n] = _v; }
@@ -63,6 +70,7 @@ public:
byte toByte(json_spirit::mValue const& _v);
void push(json_spirit::mObject& o, std::string const& _n, u256 _v);
void push(json_spirit::mArray& a, u256 _v);
+ u256 doPosts();
json_spirit::mObject exportEnv();
void importEnv(json_spirit::mObject& _o);
json_spirit::mObject exportState();
@@ -79,7 +87,7 @@ public:
u256 gas;
private:
- eth::State m_s;
+ FakeState m_s;
eth::Manifest m_ms;
};