From 473243ef3134ac1ea23396f639554a8b9e243738 Mon Sep 17 00:00:00 2001 From: Mathias Baumann Date: Tue, 7 May 2019 14:45:59 +0200 Subject: [PATCH 1/2] TestFramework: Remove polling and use eth_flush instead --- test/ExecutionFramework.cpp | 23 +---------------------- test/ExecutionFramework.h | 1 - 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/test/ExecutionFramework.cpp b/test/ExecutionFramework.cpp index 23a715133..ccb5f6119 100644 --- a/test/ExecutionFramework.cpp +++ b/test/ExecutionFramework.cpp @@ -140,7 +140,7 @@ void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256 } string txHash = m_rpc.eth_sendTransaction(d); - waitForTransaction(txHash); + m_rpc.rpcCall("eth_flush"); m_rpc.test_mineBlocks(1); RPCSession::TransactionReceipt receipt(m_rpc.eth_getTransactionReceipt(txHash)); @@ -178,27 +178,6 @@ void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256 m_transactionSuccessful = (m_gas != m_gasUsed); } -void ExecutionFramework::waitForTransaction(std::string const& _txHash) const -{ - for (int polls = 0; polls < 3000; polls++) - { - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - auto pendingBlock = m_rpc.eth_getBlockByNumber("pending", false); - - if (!pendingBlock["transactions"].empty()) - { - BOOST_REQUIRE_EQUAL(pendingBlock["transactions"][0].asString(), _txHash); - return; - } - - if (polls == 200) - { - cerr << "Note: Already used 200 iterations while waiting for transaction confirmation. Issuing an eth_flush request." << endl; - m_rpc.rpcCall("eth_flush"); - } - } -} - void ExecutionFramework::sendEther(Address const& _to, u256 const& _value) { RPCSession::TransactionData d; diff --git a/test/ExecutionFramework.h b/test/ExecutionFramework.h index 11e364c59..4a42382d0 100644 --- a/test/ExecutionFramework.h +++ b/test/ExecutionFramework.h @@ -247,7 +247,6 @@ private: protected: void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0); void sendEther(Address const& _to, u256 const& _value); - void waitForTransaction(std::string const& _txHash) const; size_t currentTimestamp(); size_t blockTimestamp(u256 _number); From d8873f52dfe5f707bb878b41647ec791eb16f694 Mon Sep 17 00:00:00 2001 From: Mathias Baumann Date: Tue, 7 May 2019 16:03:53 +0200 Subject: [PATCH 2/2] Update to aleth v1.6.0 --- docs/contributing.rst | 2 +- scripts/tests.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index 5fce8d1a6..0e0a58905 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -96,7 +96,7 @@ The option ``--no-smt`` disables the tests that require ``libz3`` and ``--no-ipc`` disables those that require ``aleth``. If you want to run the ipc tests (that test the semantics of the generated code), -you need to install `aleth `_ and run it in testing mode: ``aleth --db memorydb --test -d /tmp/testeth``. +you need to install `aleth `_ and run it in testing mode: ``aleth --db memorydb --test -d /tmp/testeth``. To run the actual tests, use: ``./scripts/soltest.sh --ipcpath /tmp/testeth/geth.ipc``. diff --git a/scripts/tests.sh b/scripts/tests.sh index 1a60ee262..d0882aff4 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -134,9 +134,9 @@ function download_aleth() ALETH_PATH="aleth" else mkdir -p /tmp/test - # Any time the hash is updated here, the "Running compiler tests" section should also be updated. - ALETH_HASH="8979a9179d5222c89bf9daf7ca73cc115fa2dac2" - ALETH_VERSION=1.6.0-rc.1 + # Any time the hash is updated here, the "Running the compiler tests" section in contributing.rst should also be updated. + ALETH_HASH="7f7004e1563299bc57882e32b32e4a195747dfb6" + ALETH_VERSION=1.6.0 wget -q -O /tmp/test/aleth.tar.gz https://github.com/ethereum/aleth/releases/download/v${ALETH_VERSION}/aleth-${ALETH_VERSION}-linux-x86_64.tar.gz test "$(shasum /tmp/test/aleth.tar.gz)" = "$ALETH_HASH /tmp/test/aleth.tar.gz" tar -xf /tmp/test/aleth.tar.gz -C /tmp/test