diff options
author | Dimitry <winsvega@mail.ru> | 2016-06-14 23:01:57 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-06-29 05:18:55 +0800 |
commit | 763faf7b0e56cde9845772de5226c9b6f1a5d80a (patch) | |
tree | 14660008fc89ee655fd51563c268d45da43b5596 /test/libsolidity/SolidityExecutionFramework.cpp | |
parent | ce2258b71e632e01b3f50d47704352065cb01b5d (diff) | |
download | dexon-solidity-763faf7b0e56cde9845772de5226c9b6f1a5d80a.tar.gz dexon-solidity-763faf7b0e56cde9845772de5226c9b6f1a5d80a.tar.zst dexon-solidity-763faf7b0e56cde9845772de5226c9b6f1a5d80a.zip |
replace BalanceAt
add addressHasCode
remove m_state and sealengine
Diffstat (limited to 'test/libsolidity/SolidityExecutionFramework.cpp')
-rw-r--r-- | test/libsolidity/SolidityExecutionFramework.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/libsolidity/SolidityExecutionFramework.cpp b/test/libsolidity/SolidityExecutionFramework.cpp index db48c3a1..43d36f38 100644 --- a/test/libsolidity/SolidityExecutionFramework.cpp +++ b/test/libsolidity/SolidityExecutionFramework.cpp @@ -30,12 +30,10 @@ using namespace dev::solidity::test; ExecutionFramework::ExecutionFramework(): - m_rpc(RPCSession::instance("/tmp/test/geth.ipc")), - m_sender(m_rpc.account(0)), - m_state(0) + m_rpc(RPCSession::instance("/home/wins/Ethereum/testnet/ethnode1/geth.ipc")), + m_sender(m_rpc.account(0)) { eth::NoProof::init(); - m_sealEngine.reset(eth::ChainParams().createSealEngine()); if (g_logVerbosity != -1) g_logVerbosity = 0; @@ -84,6 +82,12 @@ void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256 } } +bool ExecutionFramework::addressHasCode(Address const& _addr) +{ + string code = m_rpc.eth_getCode(toString(_addr), "latest"); + return !code.empty() && code != "0x"; +} + u256 ExecutionFramework::balanceAt(Address const& _addr) { return u256(m_rpc.eth_getBalance(toString(_addr), "latest")); |