diff options
author | chriseth <c@ethdev.com> | 2016-12-07 01:38:59 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-12-07 05:31:20 +0800 |
commit | 86953ca3e48bc9620e8d34ae965ba1fa65aaf4eb (patch) | |
tree | 4d9f1b5a771cc5705f5f2978a479bb61bbe10160 /test/ExecutionFramework.cpp | |
parent | b201e148fad222b1a1fe276211126305026e6168 (diff) | |
download | dexon-solidity-86953ca3e48bc9620e8d34ae965ba1fa65aaf4eb.tar.gz dexon-solidity-86953ca3e48bc9620e8d34ae965ba1fa65aaf4eb.tar.zst dexon-solidity-86953ca3e48bc9620e8d34ae965ba1fa65aaf4eb.zip |
Option to show messages in tests.
Diffstat (limited to 'test/ExecutionFramework.cpp')
-rw-r--r-- | test/ExecutionFramework.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ExecutionFramework.cpp b/test/ExecutionFramework.cpp index 0c6e0cff..9d6d5675 100644 --- a/test/ExecutionFramework.cpp +++ b/test/ExecutionFramework.cpp @@ -46,6 +46,7 @@ string getIPCSocketPath() ExecutionFramework::ExecutionFramework() : m_rpc(RPCSession::instance(getIPCSocketPath())), m_optimize(dev::test::Options::get().optimize), + m_showMessages(dev::test::Options::get().showMessages), m_sender(m_rpc.account(0)) { m_rpc.test_rewindToBlock(0); @@ -53,6 +54,13 @@ ExecutionFramework::ExecutionFramework() : void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256 const& _value) { + if (m_showMessages) + { + if (_isCreation) + cout << "CREATE " << toHex(m_sender) << ": " << toHex(_data) << endl; + else + cout << "CALL " << toHex(m_sender) << " -> " << toHex(m_contractAddress) << ": " << toHex(_data) << endl; + } RPCSession::TransactionData d; d.data = "0x" + toHex(_data); d.from = "0x" + toString(m_sender); @@ -79,6 +87,9 @@ void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256 m_output = fromHex(code, WhenError::Throw); } + if (m_showMessages) + cout << " -> " << toHex(m_output) << endl; + m_gasUsed = u256(receipt.gasUsed); m_logs.clear(); for (auto const& log: receipt.logEntries) |