aboutsummaryrefslogtreecommitdiffstats
path: root/vm.cpp
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2014-10-20 23:36:26 +0800
committerPaweł Bylica <pawel.bylica@imapp.pl>2014-10-20 23:36:26 +0800
commit1b2d4c25e6f04830209e033c9566ca19187a92ad (patch)
tree24ff45c6c28214451446f10d4d4471fcd495d4e1 /vm.cpp
parent29ad070d07a474f9115cc09ea43b559ebdcd8eb8 (diff)
downloaddexon-solidity-1b2d4c25e6f04830209e033c9566ca19187a92ad.tar.gz
dexon-solidity-1b2d4c25e6f04830209e033c9566ca19187a92ad.tar.zst
dexon-solidity-1b2d4c25e6f04830209e033c9566ca19187a92ad.zip
Another round of fixing ExtVM interface
Diffstat (limited to 'vm.cpp')
-rw-r--r--vm.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/vm.cpp b/vm.cpp
index d65b5d3d..80185f65 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -35,7 +35,7 @@ using namespace dev::test;
FakeExtVM::FakeExtVM(eth::BlockInfo const& _previousBlock, eth::BlockInfo const& _currentBlock, unsigned _depth): /// TODO: XXX: remove the default argument & fix.
ExtVMFace(Address(), Address(), Address(), 0, 1, bytesConstRef(), bytesConstRef(), _previousBlock, _currentBlock, _depth) {}
-h160 FakeExtVM::create(u256 _endowment, u256* _gas, bytesConstRef _init, OnOpFunc)
+h160 FakeExtVM::create(u256 _endowment, u256* _gas, bytesConstRef _init, OnOpFunc const&)
{
Transaction t;
t.value = _endowment;
@@ -45,7 +45,7 @@ h160 FakeExtVM::create(u256 _endowment, u256* _gas, bytesConstRef _init, OnOpFun
m_s.noteSending(myAddress);
m_ms.internal.resize(m_ms.internal.size() + 1);
- auto ret = m_s.create(myAddress, _endowment, gasPrice, _gas, _init, origin, &suicides, &m_ms ? &(m_ms.internal.back()) : nullptr, OnOpFunc(), 1);
+ auto ret = m_s.create(myAddress, _endowment, gasPrice, _gas, _init, origin, &suicides, &m_ms ? &(m_ms.internal.back()) : nullptr, {}, 1);
if (!m_ms.internal.back().from)
m_ms.internal.pop_back();
@@ -61,7 +61,7 @@ h160 FakeExtVM::create(u256 _endowment, u256* _gas, bytesConstRef _init, OnOpFun
return ret;
}
-bool FakeExtVM::call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256* _gas, bytesRef _out, OnOpFunc, Address _myAddressOverride = Address(), Address _codeAddressOverride = Address())
+bool FakeExtVM::call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256* _gas, bytesRef _out, OnOpFunc const&, Address _myAddressOverride = Address(), Address _codeAddressOverride = Address())
{
u256 contractgas = 0xffff;
@@ -91,7 +91,7 @@ bool FakeExtVM::call(Address _receiveAddress, u256 _value, bytesConstRef _data,
if (!m_s.addresses().count(myAddress))
{
m_ms.internal.resize(m_ms.internal.size() + 1);
- auto na = m_s.createNewAddress(myAddress, myAddress, balance(myAddress), gasPrice, &contractgas, init, origin, &suicides, &m_ms ? &(m_ms.internal.back()) : nullptr, OnOpFunc(), 1);
+ auto na = m_s.createNewAddress(myAddress, myAddress, balance(myAddress), gasPrice, &contractgas, init, origin, &suicides, &m_ms ? &(m_ms.internal.back()) : nullptr, {}, 1);
if (!m_ms.internal.back().from)
m_ms.internal.pop_back();
if (na != myAddress)
@@ -588,6 +588,17 @@ void doTests(json_spirit::mValue& v, bool _fillin)
else
BOOST_CHECK(output == fromHex(o["out"].get_str()));
+ //auto a = fev.addresses.at(fev.myAddress);
+ //auto b = test.addresses.at(fev.myAddress);
+
+ //auto t = a == b;
+ //auto t0 = get<0>(a) == get<0>(b);
+ //auto t1 = get<1>(a) == get<1>(b);
+ //auto t2 = get<2>(a) == get<2>(b);
+ //auto t3 = get<3>(a) == get<3>(b);
+
+ //BOOST_CHECK_EQUAL(get<0>(a), get<0>(b));
+
BOOST_CHECK(test.toInt(o["gas"]) == gas);
BOOST_CHECK(test.addresses == fev.addresses);
BOOST_CHECK(test.callcreates == fev.callcreates);