diff options
author | Gav Wood <i@gavwood.com> | 2014-02-18 21:27:13 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2014-02-18 21:27:13 +0800 |
commit | 34b1ba48147e55a064644b19276143562713726a (patch) | |
tree | 7eee2e613ca206a4b42ccb13d3b839f0d74047e5 /vm.cpp | |
parent | 815cb1392bd34158f9d710b7c34465fe6caa5454 (diff) | |
download | dexon-solidity-34b1ba48147e55a064644b19276143562713726a.tar.gz dexon-solidity-34b1ba48147e55a064644b19276143562713726a.tar.zst dexon-solidity-34b1ba48147e55a064644b19276143562713726a.zip |
Move to canon ES-1.
Minor fix for contracts.
Diffstat (limited to 'vm.cpp')
-rw-r--r-- | vm.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -36,13 +36,19 @@ template <> class UnitTest<1> public: int operator()() { + c_genesisDifficulty = (u256)1; + KeyPair p = KeyPair::create(); - Overlay o; + Overlay o(State::openDB("/tmp/vmTest", true)); State s(p.address(), o); + BlockChain bc("/tmp/vmTest", true); cout << s; - s.addBalance(p.address(), Uether); + s.commitToMine(bc); + s.mine(1000000); + bc.attemptImport(s.blockData(), o); + s.sync(bc); cout << s; @@ -50,7 +56,7 @@ public: c.receiveAddress = Address(); c.nonce = 0; - c.data = assemble("txsender load txvalue add txsender store stop"); + c.data = assemble("txsender sload txvalue add txsender sstore stop"); c.value = ether; c.sign(p.secret()); s.execute(c.rlp()); @@ -58,11 +64,14 @@ public: cout << s; - s.commit(); + s.commitToMine(bc); + s.mine(1000000); + bc.attemptImport(s.blockData(), o); + s.sync(bc); cout << s; - cout << s.m_db; +// cout << s.m_db; c.receiveAddress = ca; c.nonce = 1; @@ -73,6 +82,13 @@ public: cout << s; + s.commitToMine(bc); + s.mine(); + bc.attemptImport(s.blockData(), o); + s.sync(bc); + + cout << s; + return 0; } }; |