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/contracts/AuctionRegistrar.cpp | 1 + test/contracts/FixedFeeRegistrar.cpp | 1 + test/contracts/LLL_ENS.cpp | 1 + test/contracts/LLL_ERC20.cpp | 5 +++++ test/contracts/Wallet.cpp | 1 + 5 files changed, 9 insertions(+) (limited to 'test/contracts') diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp index f5abb83d..0b888b90 100644 --- a/test/contracts/AuctionRegistrar.cpp +++ b/test/contracts/AuctionRegistrar.cpp @@ -223,6 +223,7 @@ protected: s_compiledRegistrar.reset(new bytes(compileContract(registrarCode, "GlobalRegistrar"))); sendMessage(*s_compiledRegistrar, true); + BOOST_REQUIRE(m_transactionSuccessful); BOOST_REQUIRE(!m_output.empty()); } diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp index 142f4144..630d2ab9 100644 --- a/test/contracts/FixedFeeRegistrar.cpp +++ b/test/contracts/FixedFeeRegistrar.cpp @@ -135,6 +135,7 @@ protected: s_compiledRegistrar.reset(new bytes(compileContract(registrarCode, "FixedFeeRegistrar"))); sendMessage(*s_compiledRegistrar, true); + BOOST_REQUIRE(m_transactionSuccessful); BOOST_REQUIRE(!m_output.empty()); } u256 const m_fee = u256("69000000000000000000"); diff --git a/test/contracts/LLL_ENS.cpp b/test/contracts/LLL_ENS.cpp index 028d58c8..3461c577 100644 --- a/test/contracts/LLL_ENS.cpp +++ b/test/contracts/LLL_ENS.cpp @@ -349,6 +349,7 @@ protected: BOOST_REQUIRE(errors.empty()); } sendMessage(*s_compiledEns, true); + BOOST_REQUIRE(m_transactionSuccessful); BOOST_REQUIRE(!m_output.empty()); } diff --git a/test/contracts/LLL_ERC20.cpp b/test/contracts/LLL_ERC20.cpp index 60b43e4f..89d1c4f0 100644 --- a/test/contracts/LLL_ERC20.cpp +++ b/test/contracts/LLL_ERC20.cpp @@ -400,6 +400,7 @@ protected: BOOST_REQUIRE(errors.empty()); } sendMessage(*s_compiledErc20, true); + BOOST_REQUIRE(m_transactionSuccessful); BOOST_REQUIRE(!m_output.empty()); } @@ -629,18 +630,22 @@ BOOST_AUTO_TEST_CASE(bad_data) // Correct data: transfer(address _to, 1). sendMessage((bytes)fromHex("a9059cbb") + (bytes)fromHex("000000000000000000000000123456789a123456789a123456789a123456789a") + encodeArgs(1), false, 0); + BOOST_CHECK(m_transactionSuccessful); BOOST_CHECK(m_output == SUCCESS); // Too little data (address is truncated by one byte). sendMessage((bytes)fromHex("a9059cbb") + (bytes)fromHex("000000000000000000000000123456789a123456789a123456789a12345678") + encodeArgs(1), false, 0); + BOOST_CHECK(!m_transactionSuccessful); BOOST_CHECK(m_output != SUCCESS); // Too much data (address is extended with a zero byte). sendMessage((bytes)fromHex("a9059cbb") + (bytes)fromHex("000000000000000000000000123456789a123456789a123456789a123456789a00") + encodeArgs(1), false, 0); + BOOST_CHECK(!m_transactionSuccessful); BOOST_CHECK(m_output != SUCCESS); // Invalid address (a bit above the 160th is set). sendMessage((bytes)fromHex("a9059cbb") + (bytes)fromHex("000000000000000000000100123456789a123456789a123456789a123456789a") + encodeArgs(1), false, 0); + BOOST_CHECK(!m_transactionSuccessful); BOOST_CHECK(m_output != SUCCESS); } diff --git a/test/contracts/Wallet.cpp b/test/contracts/Wallet.cpp index 6328b518..470551df 100644 --- a/test/contracts/Wallet.cpp +++ b/test/contracts/Wallet.cpp @@ -451,6 +451,7 @@ protected: bytes args = encodeArgs(u256(0x60), _required, _dailyLimit, u256(_owners.size()), _owners); sendMessage(*s_compiledWallet + args, true, _value); + BOOST_REQUIRE(m_transactionSuccessful); BOOST_REQUIRE(!m_output.empty()); } }; -- cgit