diff options
Diffstat (limited to 'test/ExecutionFramework.cpp')
-rw-r--r-- | test/ExecutionFramework.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ExecutionFramework.cpp b/test/ExecutionFramework.cpp index 00f5e697..ea624735 100644 --- a/test/ExecutionFramework.cpp +++ b/test/ExecutionFramework.cpp @@ -85,6 +85,22 @@ std::pair<bool, string> ExecutionFramework::compareAndCreateMessage( return make_pair(false, message); } +u256 ExecutionFramework::gasLimit() const +{ + auto latestBlock = m_rpc.eth_getBlockByNumber("latest", false); + return u256(latestBlock["gasLimit"].asString()); +} + +u256 ExecutionFramework::gasPrice() const +{ + return u256(m_rpc.eth_gasPrice()); +} + +u256 ExecutionFramework::blockHash(u256 const& _blockNumber) const +{ + return u256(m_rpc.eth_getBlockByNumber(toHex(_blockNumber, HexPrefix::Add), false)["hash"].asString()); +} + void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256 const& _value) { if (m_showMessages) |