mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove VMTRACE.
Better transaction logging. Avoid bothering with obviously invalid transactions.
This commit is contained in:
parent
68b61432ae
commit
fff3784c01
@ -172,7 +172,7 @@ void ImportTest::importTransaction(json_spirit::mObject& _o)
|
|||||||
{
|
{
|
||||||
RLPStream transactionRLPStream = createRLPStreamFromTransactionFields(_o);
|
RLPStream transactionRLPStream = createRLPStreamFromTransactionFields(_o);
|
||||||
RLP transactionRLP(transactionRLPStream.out());
|
RLP transactionRLP(transactionRLPStream.out());
|
||||||
m_transaction = Transaction(transactionRLP.data(), CheckSignature::Sender);
|
m_transaction = Transaction(transactionRLP.data(), CheckTransaction::Everything);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Transaction t(createRLPStreamFromTransactionFields(tx).out(), CheckSignature::Sender);
|
Transaction t(createRLPStreamFromTransactionFields(tx).out(), CheckTransaction::Everything);
|
||||||
txsFromField.push_back(t);
|
txsFromField.push_back(t);
|
||||||
}
|
}
|
||||||
catch (Exception const& _e)
|
catch (Exception const& _e)
|
||||||
@ -400,7 +400,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
|
|||||||
RLP root(blockRLP);
|
RLP root(blockRLP);
|
||||||
for (auto const& tr: root[1])
|
for (auto const& tr: root[1])
|
||||||
{
|
{
|
||||||
Transaction tx(tr.data(), CheckSignature::Sender);
|
Transaction tx(tr.data(), CheckTransaction::Everything);
|
||||||
txsFromRlp.push_back(tx);
|
txsFromRlp.push_back(tx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ void doTransactionTests(json_spirit::mValue& _v, bool _fillin)
|
|||||||
{
|
{
|
||||||
bytes stream = importByteArray(o["rlp"].get_str());
|
bytes stream = importByteArray(o["rlp"].get_str());
|
||||||
RLP rlp(stream);
|
RLP rlp(stream);
|
||||||
txFromRlp = Transaction(rlp.data(), CheckSignature::Sender);
|
txFromRlp = Transaction(rlp.data(), CheckTransaction::Everything);
|
||||||
if (!txFromRlp.signature().isValid())
|
if (!txFromRlp.signature().isValid())
|
||||||
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("transaction from RLP signature is invalid") );
|
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("transaction from RLP signature is invalid") );
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ void doTransactionTests(json_spirit::mValue& _v, bool _fillin)
|
|||||||
BOOST_REQUIRE(o.count("transaction") > 0);
|
BOOST_REQUIRE(o.count("transaction") > 0);
|
||||||
|
|
||||||
mObject tObj = o["transaction"].get_obj();
|
mObject tObj = o["transaction"].get_obj();
|
||||||
Transaction txFromFields(createRLPStreamFromTransactionFields(tObj).out(), CheckSignature::Sender);
|
Transaction txFromFields(createRLPStreamFromTransactionFields(tObj).out(), CheckTransaction::Everything);
|
||||||
|
|
||||||
//Check the fields restored from RLP to original fields
|
//Check the fields restored from RLP to original fields
|
||||||
BOOST_CHECK_MESSAGE(txFromFields.data() == txFromRlp.data(), "Data in given RLP not matching the Transaction data!");
|
BOOST_CHECK_MESSAGE(txFromFields.data() == txFromRlp.data(), "Data in given RLP not matching the Transaction data!");
|
||||||
@ -91,7 +91,7 @@ void doTransactionTests(json_spirit::mValue& _v, bool _fillin)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Transaction txFromFields(rlpStream.out(), CheckSignature::Sender);
|
Transaction txFromFields(rlpStream.out(), CheckTransaction::Everything);
|
||||||
if (!txFromFields.signature().isValid())
|
if (!txFromFields.signature().isValid())
|
||||||
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("transaction from RLP signature is invalid") );
|
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("transaction from RLP signature is invalid") );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user