From 0319b184ce2e297584097e92a16cb695255f4246 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 14 Jun 2018 16:41:02 +0200 Subject: Add difficulty field to genesis chain parameters to fix ipc tests for recent versions of cpp-ethereum. --- test/RPCSession.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/RPCSession.cpp') diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index f4eae865..4671edf4 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -244,7 +244,8 @@ void RPCSession::test_setChainParams(vector const& _accounts) "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x", - "gasLimit": "0x1000000000000" + "gasLimit": "0x1000000000000", + "difficulty": "1" }, "accounts": { "0000000000000000000000000000000000000001": { "wei": "1", "precompiled": { "name": "ecrecover", "linear": { "base": 3000, "word": 0 } } }, -- cgit v1.2.3 From f44561aeebf4685364d2e3b9cbff1382ba1f6507 Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Mon, 25 Jun 2018 13:55:23 +0200 Subject: Fixes soltest against "recent" cpp-ethereum builds. For me, it looks like the following Git commit has introduced this behaviour: https://github.com/ethereum/cpp-ethereum/commit/42b927d7aa103e21e34c8ba8c5469f532b49f966 This commit adds dummy values for `mixHash` and `nonce` (inspired by values were cpp-ethereum's own tests), and now, soltest runs fine again. --- test/RPCSession.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/RPCSession.cpp') diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index 4671edf4..160b0047 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -245,6 +245,8 @@ void RPCSession::test_setChainParams(vector const& _accounts) "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x", "gasLimit": "0x1000000000000", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000042", "difficulty": "1" }, "accounts": { -- cgit v1.2.3 From 7b7df90e7643f09e8bbc6592b5d3e974919ebac4 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Sat, 30 Jun 2018 13:07:30 +0300 Subject: fix default difficulty to comply with YP rules fix soltest to work with the recent aleth --test --- test/RPCSession.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/RPCSession.cpp') diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index 160b0047..48c8a249 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -247,8 +247,8 @@ void RPCSession::test_setChainParams(vector const& _accounts) "gasLimit": "0x1000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000042", - "difficulty": "1" - }, + "difficulty": "131072" + }, "accounts": { "0000000000000000000000000000000000000001": { "wei": "1", "precompiled": { "name": "ecrecover", "linear": { "base": 3000, "word": 0 } } }, "0000000000000000000000000000000000000002": { "wei": "1", "precompiled": { "name": "sha256", "linear": { "base": 60, "word": 12 } } }, -- cgit v1.2.3 From 334c023c7231810f28ca5ea04f14df3f722cea07 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Fri, 15 Jun 2018 12:18:00 +0200 Subject: Determine transaction status in RPC sessions. --- test/RPCSession.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/RPCSession.cpp') diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index 160b0047..9a253794 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -163,6 +163,11 @@ RPCSession::TransactionReceipt RPCSession::eth_getTransactionReceipt(string cons receipt.gasUsed = result["gasUsed"].asString(); receipt.contractAddress = result["contractAddress"].asString(); receipt.blockNumber = result["blockNumber"].asString(); + if (m_receiptHasStatusField) + { + BOOST_REQUIRE(!result["status"].isNull()); + receipt.status = result["status"].asString(); + } for (auto const& log: result["logs"]) { LogEntry entry; @@ -225,7 +230,10 @@ void RPCSession::test_setChainParams(vector const& _accounts) if (test::Options::get().evmVersion() >= solidity::EVMVersion::spuriousDragon()) forks += "\"EIP158ForkBlock\": \"0x00\",\n"; if (test::Options::get().evmVersion() >= solidity::EVMVersion::byzantium()) + { forks += "\"byzantiumForkBlock\": \"0x00\",\n"; + m_receiptHasStatusField = true; + } if (test::Options::get().evmVersion() >= solidity::EVMVersion::constantinople()) forks += "\"constantinopleForkBlock\": \"0x00\",\n"; static string const c_configString = R"( -- cgit v1.2.3 From 06b7edfdcfd960e5d4012c7d20913efab0516ca1 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Fri, 10 Aug 2018 19:19:21 +0200 Subject: Add missing tests for ``gasleft()``, ``blockhash()`` ``tx.gasprice`` and ``block.gaslimit``. --- test/RPCSession.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/RPCSession.cpp') diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index b9b19b2f..9ac24972 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -207,6 +207,11 @@ string RPCSession::eth_getStorageRoot(string const& _address, string const& _blo return rpcCall("eth_getStorageRoot", { quote(address), quote(_blockNumber) }).asString(); } +string RPCSession::eth_gasPrice() +{ + return rpcCall("eth_gasPrice").asString(); +} + void RPCSession::personal_unlockAccount(string const& _address, string const& _password, int _duration) { BOOST_REQUIRE_MESSAGE( -- cgit v1.2.3