aboutsummaryrefslogtreecommitdiffstats
path: root/test/ExecutionFramework.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-03-16 01:07:52 +0800
committerGitHub <noreply@github.com>2017-03-16 01:07:52 +0800
commitf0d539ae05739e35336cc9cc8f44bd9798a95c28 (patch)
tree13ef1dea012c7f093122d5e7578dc3c893636e59 /test/ExecutionFramework.cpp
parent364da425d3116a4b85863df39a1864340861d71e (diff)
parent59099908c53129b2f5723bd0d5283c4da089e398 (diff)
downloaddexon-solidity-f0d539ae05739e35336cc9cc8f44bd9798a95c28.tar
dexon-solidity-f0d539ae05739e35336cc9cc8f44bd9798a95c28.tar.gz
dexon-solidity-f0d539ae05739e35336cc9cc8f44bd9798a95c28.tar.bz2
dexon-solidity-f0d539ae05739e35336cc9cc8f44bd9798a95c28.tar.lz
dexon-solidity-f0d539ae05739e35336cc9cc8f44bd9798a95c28.tar.xz
dexon-solidity-f0d539ae05739e35336cc9cc8f44bd9798a95c28.tar.zst
dexon-solidity-f0d539ae05739e35336cc9cc8f44bd9798a95c28.zip
Merge pull request #1782 from ethereum/develop
Solidity 0.4.10
Diffstat (limited to 'test/ExecutionFramework.cpp')
-rw-r--r--test/ExecutionFramework.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/ExecutionFramework.cpp b/test/ExecutionFramework.cpp
index ddcd9cb6..f4e5fcef 100644
--- a/test/ExecutionFramework.cpp
+++ b/test/ExecutionFramework.cpp
@@ -82,6 +82,8 @@ void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256
m_rpc.test_mineBlocks(1);
RPCSession::TransactionReceipt receipt(m_rpc.eth_getTransactionReceipt(txHash));
+ m_blockNumber = u256(receipt.blockNumber);
+
if (_isCreation)
{
m_contractAddress = Address(receipt.contractAddress);
@@ -125,7 +127,13 @@ void ExecutionFramework::sendEther(Address const& _to, u256 const& _value)
size_t ExecutionFramework::currentTimestamp()
{
- auto latestBlock = m_rpc.rpcCall("eth_getBlockByNumber", {"\"latest\"", "false"});
+ auto latestBlock = m_rpc.eth_getBlockByNumber("latest", false);
+ return size_t(u256(latestBlock.get("timestamp", "invalid").asString()));
+}
+
+size_t ExecutionFramework::blockTimestamp(u256 _number)
+{
+ auto latestBlock = m_rpc.eth_getBlockByNumber(toString(_number), false);
return size_t(u256(latestBlock.get("timestamp", "invalid").asString()));
}