Skip to content

Commit

Permalink
fill state test as blockchain was missing bigInt hint field
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Jun 18, 2024
1 parent 006f498 commit df8ccbb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions retesteth/session/ToolBackend/Functions/importRawBlock.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "../ToolChainManager.h"
#include "../ToolImplHelper.h"
#include "../Verification.h"
#include <retesteth/Options.h>
#include <retesteth/helpers/TestHelper.h>
#include <retesteth/testStructures/types/Ethereum/Transactions/TransactionBlob.h>
using namespace std;
Expand Down
5 changes: 4 additions & 1 deletion retesteth/session/ToolBackend/ToolChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,12 @@ spDataObject ToolChain::coorectTransactionsByToolResponse(
}
else
{
ETH_DC_MESSAGE(DC::RPC, "Transactions not allowed to fail!");
if (rejectedInfoFound)
{
ETH_DC_MESSAGE(DC::RPC, "Transactions not allowed to fail! But t8n rejected it!");
throw test::UpwardsException((*miningResult)["rejectedTransactions"].atLastElement().atKey("error").asString());
}
ETH_DC_MESSAGE(DC::RPC, "Transactions not allowed to fail, t8n does not provide rejected info!");
throw test::UpwardsException(message);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void Transaction::fromDataObject(DataObject const& _data)
{
checkDataScheme(_data);
_fromData(_data);
m_hasBigInt = _data.performSearch(src_findBigInt);
makeSignature(_data);
}
catch (std::exception const& _ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ struct Transaction : GCP_SPointerBase
VALUE const& getSecret() const { return m_secretKey; }
void setChainID(VALUE const& _chainID);
VALUE const& getChainID() const { return m_chainID; }
bool hasBigInt() const { return m_hasBigInt; }

protected:
// Potected transaction interface
Expand Down Expand Up @@ -86,6 +87,7 @@ struct Transaction : GCP_SPointerBase
// Debug
std::string m_dataRawPreview; // Attached data raw preview before code compilation
std::string m_dataLabel; // Attached data Label from filler
bool m_hasBigInt = false;

// Optimization
spFH32 m_hash;
Expand Down
4 changes: 4 additions & 0 deletions retesteth/testSuites/statetests/StateTestChainRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ void StateTestChainRunner::performTransactionOnExpect(TransactionInGeneralSectio
(*m_aBlockchainTest)["lastblockhash"] = remoteBlock.header()->hash().asString();
spDataObject block;
(*block)["rlp"] = remoteBlock.getRLPHeaderTransactions().asString();
if (_tr.transaction()->hasBigInt())
(*block)["hasBigInt"] = "true";
(*block).atKeyPointer("blockHeader") = remoteBlock.header()->asDataObject();
(*block).atKeyPointer("transactions") = spDataObject(new DataObject(DataType::Array));
if (testException.empty())
Expand All @@ -90,6 +92,8 @@ void StateTestChainRunner::performTransactionOnExpect(TransactionInGeneralSectio
(*trInfo)["exception"] = testException;
(*block)["transactionSequence"].addArrayObject(trInfo);
(*block)["expectException"] = testException;
if (_tr.transaction()->hasBigInt())
(*block)["hasBigInt"] = "true";

EthereumBlock managedBlock(remoteBlock.header());
managedBlock.addTransaction(_tr.transaction());
Expand Down
4 changes: 4 additions & 0 deletions retesteth/testSuites/statetests/StateTestsBoost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ TestSuite::FillerPath LegacyConstantinopleStateTestSuite::suiteFillerFolder() co
// Legacy Cancun
TestSuite::TestPath LegacyCancunStateTestSuite::suiteFolder() const
{
if (Options::get().fillchain)
{
return TestSuite::TestPath(fs::path("LegacyTests/Cancun/BlockchainTests/GeneralStateTests" + m_fillerPathAdd));
}
return TestSuite::TestPath(fs::path("LegacyTests/Cancun/GeneralStateTests" + m_fillerPathAdd));
}
TestSuite::FillerPath LegacyCancunStateTestSuite::suiteFillerFolder() const
Expand Down

0 comments on commit df8ccbb

Please sign in to comment.