mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Determine transaction status in RPC sessions.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -349,6 +349,7 @@ protected:
|
||||
BOOST_REQUIRE(errors.empty());
|
||||
}
|
||||
sendMessage(*s_compiledEns, true);
|
||||
BOOST_REQUIRE(m_transactionSuccessful);
|
||||
BOOST_REQUIRE(!m_output.empty());
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user