mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test related
Constant in TestHelper.h Exception in TestHelper.h
This commit is contained in:
parent
d77b3a672c
commit
c09b7885e8
@ -108,10 +108,9 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state)
|
||||
BOOST_REQUIRE(o.count("storage") > 0);
|
||||
BOOST_REQUIRE(o.count("code") > 0);
|
||||
|
||||
bigint biValue256 = bigint(1) << 256;
|
||||
if (bigint(o["balance"].get_str()) >= biValue256)
|
||||
if (bigint(o["balance"].get_str()) >= c_max256plus1)
|
||||
BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("State 'balance' is equal or greater than 2**256") );
|
||||
if (bigint(o["nonce"].get_str()) >= biValue256)
|
||||
if (bigint(o["nonce"].get_str()) >= c_max256plus1)
|
||||
BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("State 'nonce' is equal or greater than 2**256") );
|
||||
|
||||
Address address = Address(i.first);
|
||||
@ -146,14 +145,13 @@ void ImportTest::importTransaction(json_spirit::mObject& _o)
|
||||
BOOST_REQUIRE(_o.count("secretKey") > 0);
|
||||
BOOST_REQUIRE(_o.count("data") > 0);
|
||||
|
||||
bigint biValue256 = bigint(1) << 256;
|
||||
if (bigint(_o["nonce"].get_str()) >= biValue256)
|
||||
if (bigint(_o["nonce"].get_str()) >= c_max256plus1)
|
||||
BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("Transaction 'nonce' is equal or greater than 2**256") );
|
||||
if (bigint(_o["gasPrice"].get_str()) >= biValue256)
|
||||
if (bigint(_o["gasPrice"].get_str()) >= c_max256plus1)
|
||||
BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("Transaction 'gasPrice' is equal or greater than 2**256") );
|
||||
if (bigint(_o["gasLimit"].get_str()) >= biValue256)
|
||||
if (bigint(_o["gasLimit"].get_str()) >= c_max256plus1)
|
||||
BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("Transaction 'gasLimit' is equal or greater than 2**256") );
|
||||
if (bigint(_o["value"].get_str()) >= biValue256)
|
||||
if (bigint(_o["value"].get_str()) >= c_max256plus1)
|
||||
BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("Transaction 'value' is equal or greater than 2**256") );
|
||||
|
||||
m_transaction = _o["to"].get_str().empty() ?
|
||||
|
@ -42,6 +42,9 @@ void connectClients(Client& c1, Client& c2);
|
||||
namespace test
|
||||
{
|
||||
|
||||
struct ValueTooLarge: virtual Exception {};
|
||||
bigint const c_max256plus1 = bigint(1) << 256;
|
||||
|
||||
class ImportTest
|
||||
{
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user