Skip to content

Commit

Permalink
#1751 case where no contract is called
Browse files Browse the repository at this point in the history
  • Loading branch information
kladkogex committed Jan 15, 2024
1 parent 8f3a34c commit 7f92009
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/historicstate/hardhat/scripts/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,31 @@ async function verifyDefaultTraceAgainstGethTrace(_fileName: string) {
await expect(foundDiffs).to.be.eq(false)
}

async function verifyDefaultTransferTraceAgainstGethTrace(_fileName: string) {

console.log("Verifying " + _fileName);

const _expectedResultFileName = GETH_TRACES_DIR + _fileName;
const _actualResultFileName = SKALE_TRACES_DIR + _fileName;

let expectedResult = await readJSONFile(_expectedResultFileName)
let actualResult = await readJSONFile(_actualResultFileName)

const differences = deepDiff(expectedResult, actualResult)!;

let foundDiffs = false;


if (differences) {
differences.forEach((difference, index) => {
foundDiffs = true;
});
}
;

await expect(foundDiffs).to.be.eq(false)
}


async function verifyCallTraceAgainstGethTrace(_fileName: string) {

Expand Down Expand Up @@ -566,6 +591,7 @@ async function main(): Promise<void> {
}


await verifyDefaultTransferTraceAgainstGethTrace(TEST_TRANSFER_FILE_NAME)

await verifyDefaultTraceAgainstGethTrace(TEST_CONTRACT_DEPLOY_FILE_NAME)
await verifyDefaultTraceAgainstGethTrace(TEST_CONTRACT_RUN_FILE_NAME)
Expand All @@ -575,6 +601,7 @@ async function main(): Promise<void> {
await verifyPrestateTraceAgainstGethTrace(TEST_CONTRACT_CALL_PRESTATETRACER_FILE_NAME)
await verifyPrestateDiffTraceAgainstGethTrace(TEST_CONTRACT_CALL_PRESTATEDIFFTRACER_FILE_NAME)


}


Expand Down

0 comments on commit 7f92009

Please sign in to comment.