TBOOST_REQUIRE_MESSAGE((s.length()>0),"Contents of "+testPath+"/"+_name+".json is empty. Have you cloned the 'tests' repo branch develop and set ETHEREUM_TEST_PATH to its path?");
@ -773,7 +787,26 @@ Options::Options()
}
elseif(arg=="--fulloutput")
fulloutput=true;
elseif(arg=="--verbosity"&&i+1<argc)
{
staticstd::ostringstreamstrCout;//static string to redirect logs to
std::stringindentLevel=std::string{argv[i+1]};
if(indentLevel=="0")
{
logVerbosity=Verbosity::None;
std::cout.rdbuf(strCout.rdbuf());
std::cerr.rdbuf(strCout.rdbuf());
}
elseif(indentLevel=="1")
logVerbosity=Verbosity::NiceReport;
else
logVerbosity=Verbosity::Full;
}
}
//Default option
if(logVerbosity==Verbosity::NiceReport)
g_logVerbosity=-1;//disable cnote but leave cerr and cout
//Check the fields restored from RLP to original fields
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.headerHash(WithProof)==blockFromRlp.headerHash(WithProof)),"hash in given RLP not matching the block hash!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.parentHash()==blockFromRlp.parentHash()),"parentHash in given RLP not matching the block parentHash!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.sha3Uncles()==blockFromRlp.sha3Uncles()),"sha3Uncles in given RLP not matching the block sha3Uncles!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.beneficiary()==blockFromRlp.beneficiary()),"beneficiary in given RLP not matching the block beneficiary!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.stateRoot()==blockFromRlp.stateRoot()),"stateRoot in given RLP not matching the block stateRoot!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.transactionsRoot()==blockFromRlp.transactionsRoot()),"transactionsRoot in given RLP not matching the block transactionsRoot!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.receiptsRoot()==blockFromRlp.receiptsRoot()),"receiptsRoot in given RLP not matching the block receiptsRoot!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.logBloom()==blockFromRlp.logBloom()),"logBloom in given RLP not matching the block logBloom!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.difficulty()==blockFromRlp.difficulty()),"difficulty in given RLP not matching the block difficulty!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.number()==blockFromRlp.number()),"number in given RLP not matching the block number!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.gasLimit()==blockFromRlp.gasLimit()),"gasLimit in given RLP not matching the block gasLimit!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.gasUsed()==blockFromRlp.gasUsed()),"gasUsed in given RLP not matching the block gasUsed!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.timestamp()==blockFromRlp.timestamp()),"timestamp in given RLP not matching the block timestamp!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.extraData()==blockFromRlp.extraData()),"extraData in given RLP not matching the block extraData!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.mixHash()==blockFromRlp.mixHash()),"mixHash in given RLP not matching the block mixHash!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.nonce()==blockFromRlp.nonce()),"nonce in given RLP not matching the block nonce!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.headerHash(WithProof)==blockFromRlp.headerHash(WithProof)),testname+"hash in given RLP not matching the block hash!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.parentHash()==blockFromRlp.parentHash()),testname+"parentHash in given RLP not matching the block parentHash!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.sha3Uncles()==blockFromRlp.sha3Uncles()),testname+"sha3Uncles in given RLP not matching the block sha3Uncles!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.beneficiary()==blockFromRlp.beneficiary()),testname+"beneficiary in given RLP not matching the block beneficiary!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.stateRoot()==blockFromRlp.stateRoot()),testname+"stateRoot in given RLP not matching the block stateRoot!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.transactionsRoot()==blockFromRlp.transactionsRoot()),testname+"transactionsRoot in given RLP not matching the block transactionsRoot!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.receiptsRoot()==blockFromRlp.receiptsRoot()),testname+"receiptsRoot in given RLP not matching the block receiptsRoot!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.logBloom()==blockFromRlp.logBloom()),testname+"logBloom in given RLP not matching the block logBloom!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.difficulty()==blockFromRlp.difficulty()),testname+"difficulty in given RLP not matching the block difficulty!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.number()==blockFromRlp.number()),testname+"number in given RLP not matching the block number!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.gasLimit()==blockFromRlp.gasLimit()),"testname + gasLimit in given RLP not matching the block gasLimit!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.gasUsed()==blockFromRlp.gasUsed()),testname+"gasUsed in given RLP not matching the block gasUsed!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.timestamp()==blockFromRlp.timestamp()),testname+"timestamp in given RLP not matching the block timestamp!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.extraData()==blockFromRlp.extraData()),testname+"extraData in given RLP not matching the block extraData!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.mixHash()==blockFromRlp.mixHash()),testname+"mixHash in given RLP not matching the block mixHash!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.nonce()==blockFromRlp.nonce()),testname+"nonce in given RLP not matching the block nonce!");
TBOOST_CHECK_MESSAGE((txsFromField[i].data()==txsFromRlp[i].data()),"transaction data in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].gas()==txsFromRlp[i].gas()),"transaction gasLimit in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].gasPrice()==txsFromRlp[i].gasPrice()),"transaction gasPrice in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].nonce()==txsFromRlp[i].nonce()),"transaction nonce in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].signature().r==txsFromRlp[i].signature().r),"transaction r in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].signature().s==txsFromRlp[i].signature().s),"transaction s in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].signature().v==txsFromRlp[i].signature().v),"transaction v in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].receiveAddress()==txsFromRlp[i].receiveAddress()),"transaction receiveAddress in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].value()==txsFromRlp[i].value()),"transaction receiveAddress in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i]==txsFromRlp[i]),"transactions from rlp and transaction from field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].rlp()==txsFromRlp[i].rlp()),"transactions rlp do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].data()==txsFromRlp[i].data()),testname+"transaction data in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].gas()==txsFromRlp[i].gas()),testname+"transaction gasLimit in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].gasPrice()==txsFromRlp[i].gasPrice()),testname+"transaction gasPrice in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].nonce()==txsFromRlp[i].nonce()),testname+"transaction nonce in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].signature().r==txsFromRlp[i].signature().r),testname+"transaction r in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].signature().s==txsFromRlp[i].signature().s),testname+"transaction s in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].signature().v==txsFromRlp[i].signature().v),testname+"transaction v in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].receiveAddress()==txsFromRlp[i].receiveAddress()),testname+"transaction receiveAddress in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].value()==txsFromRlp[i].value()),testname+"transaction receiveAddress in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i]==txsFromRlp[i]),testname+"transactions from rlp and transaction from field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].rlp()==txsFromRlp[i].rlp()),testname+"transactions rlp do not match");
//Check the fields restored from RLP to original fields
TBOOST_CHECK_MESSAGE((txFromFields.data()==txFromRlp.data()),"Data in given RLP not matching the Transaction data!");
TBOOST_CHECK_MESSAGE((txFromFields.value()==txFromRlp.value()),"Value in given RLP not matching the Transaction value!");
TBOOST_CHECK_MESSAGE((txFromFields.gasPrice()==txFromRlp.gasPrice()),"GasPrice in given RLP not matching the Transaction gasPrice!");
TBOOST_CHECK_MESSAGE((txFromFields.gas()==txFromRlp.gas()),"Gas in given RLP not matching the Transaction gas!");
TBOOST_CHECK_MESSAGE((txFromFields.nonce()==txFromRlp.nonce()),"Nonce in given RLP not matching the Transaction nonce!");
TBOOST_CHECK_MESSAGE((txFromFields.receiveAddress()==txFromRlp.receiveAddress()),"Receive address in given RLP not matching the Transaction 'to' address!");
TBOOST_CHECK_MESSAGE((txFromFields.sender()==txFromRlp.sender()),"Transaction sender address in given RLP not matching the Transaction 'vrs' signature!");
TBOOST_CHECK_MESSAGE((txFromFields.data()==txFromRlp.data()),testname+"Data in given RLP not matching the Transaction data!");
TBOOST_CHECK_MESSAGE((txFromFields.value()==txFromRlp.value()),testname+"Value in given RLP not matching the Transaction value!");
TBOOST_CHECK_MESSAGE((txFromFields.gasPrice()==txFromRlp.gasPrice()),testname+"GasPrice in given RLP not matching the Transaction gasPrice!");
TBOOST_CHECK_MESSAGE((txFromFields.gas()==txFromRlp.gas()),testname+"Gas in given RLP not matching the Transaction gas!");
TBOOST_CHECK_MESSAGE((txFromFields.nonce()==txFromRlp.nonce()),testname+"Nonce in given RLP not matching the Transaction nonce!");
TBOOST_CHECK_MESSAGE((txFromFields.receiveAddress()==txFromRlp.receiveAddress()),testname+"Receive address in given RLP not matching the Transaction 'to' address!");
TBOOST_CHECK_MESSAGE((txFromFields.sender()==txFromRlp.sender()),testname+"Transaction sender address in given RLP not matching the Transaction 'vrs' signature!");
TBOOST_CHECK_MESSAGE((txFromFields.sender()==addressReaded||txFromRlp.sender()==addressReaded),"Signature address of sender does not match given sender address!");
TBOOST_CHECK_MESSAGE((txFromFields.sender()==addressReaded||txFromRlp.sender()==addressReaded),testname+"Signature address of sender does not match given sender address!");
BOOST_REQUIRE_MESSAGE(s.length()>0,"Content of "+path.string()+" is empty. Have you cloned the 'tests' repo branch develop and set ETHEREUM_TEST_PATH to its path?");