|
|
@ -25,39 +25,35 @@ |
|
|
|
#include <libevm/VMFace.h> |
|
|
|
#include <libethcore/Common.h> |
|
|
|
|
|
|
|
/*
|
|
|
|
Transaction::Transaction(bytesConstRef _rlpData, CheckTransaction _checkSig): |
|
|
|
TransactionBase(_rlpData, _checkSig) |
|
|
|
{ |
|
|
|
if (_checkSig >= CheckTransaction::Cheap && !checkPayment()) |
|
|
|
BOOST_THROW_EXCEPTION(OutOfGasIntrinsic() << RequirementError(gasRequired(), (bigint)gas())); |
|
|
|
} |
|
|
|
|
|
|
|
bigint Transaction::gasRequired() const |
|
|
|
{ |
|
|
|
if (!m_gasRequired) |
|
|
|
m_gasRequired = Transaction::gasRequired(m_data); |
|
|
|
return m_gasRequired; |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
using namespace dev; |
|
|
|
using namespace eth; |
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE(libethereum) |
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(TransactionGasRequired) |
|
|
|
{ |
|
|
|
Transaction tr(fromHex("0xf86d800182521c94095e7baea6a6c7c4c2dfeb977efac326af552d870a8e0358ac39584bc98a7c979f984b031ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"), CheckTransaction::None); |
|
|
|
BOOST_CHECK_MESSAGE(tr.gasRequired() == 21952, "Transaction::GasRequired() has changed!"); |
|
|
|
} |
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(TransactionConstructor) |
|
|
|
{ |
|
|
|
bool wasException = false; |
|
|
|
try |
|
|
|
{ |
|
|
|
Transaction(fromHex("0xf86d800182521c94095e7baea6a6c7c4c2dfeb977efac326af552d870a8e0358ac39584bc98a7c979f984b031ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"), CheckTransaction::Everything); |
|
|
|
} |
|
|
|
case(Exception::) |
|
|
|
catch(OutOfGasIntrinsic) |
|
|
|
{ |
|
|
|
|
|
|
|
wasException = true; |
|
|
|
} |
|
|
|
catch(Exception) |
|
|
|
{ |
|
|
|
BOOST_ERROR("Exception thrown but expected OutOfGasIntrinsic instead"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!wasException) |
|
|
|
BOOST_ERROR("Expected OutOfGasIntrinsic exception to be thrown at TransactionConstructor test"); |
|
|
|
} |
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(ExecutionResultOutput) |
|
|
|