Determine transaction status in RPC sessions.

This commit is contained in:
Daniel Kirchner
2018-07-02 12:56:33 +02:00
parent a5608b31a7
commit 334c023c72
13 changed files with 57 additions and 1 deletions
+1
View File
@@ -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());
}
+1
View File
@@ -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");
+1
View File
@@ -349,6 +349,7 @@ protected:
BOOST_REQUIRE(errors.empty());
}
sendMessage(*s_compiledEns, true);
BOOST_REQUIRE(m_transactionSuccessful);
BOOST_REQUIRE(!m_output.empty());
}
+5
View File
@@ -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);
}
+1
View File
@@ -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());
}
};