Skip to content

Commit

Permalink
#1748 fixing compatibiliti with geth prestate
Browse files Browse the repository at this point in the history
  • Loading branch information
kladkogex committed Dec 26, 2023
1 parent cdf1ff2 commit dcd700e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"from": "0xce5c7ca85f8cb94fa284a303348ef42add23f5e7",
"from": "CALL.address",
"gas": "0x2faf080",
"gasUsed": "0x5bb7",
"to": "Tracer.address",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"0x0000000000000000000000000000000000000000": {
"balance": "0x3852c5"
},
"0xce5c7ca85f8cb94fa284a303348ef42add23f5e7": {
"balance": "0x0"
"balance": "0xb85475"
},
"Tracer.address": {
"balance": "0x0",
Expand All @@ -12,5 +9,8 @@
"storage": {
"0x0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"CALL.address": {
"balance": "0x0"
}
}
13 changes: 13 additions & 0 deletions test/historicstate/hardhat/scripts/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,14 @@ async function callDebugTraceCall(_deployedContract: any, _tracer: string, _trac
writeFileSync(SKALE_TRACES_DIR + _traceFileName, traceResult);

let deployedContractAddressLowerCase = _deployedContract.address.toString().toLowerCase();
let callAddressLowerCase = CALL_ADDRESS.toLowerCase();

await replaceStringInFile(SKALE_TRACES_DIR + _traceFileName ,
deployedContractAddressLowerCase, TEST_CONTRACT_NAME + ".address");

await replaceStringInFile(SKALE_TRACES_DIR + _traceFileName ,
callAddressLowerCase, "CALL.address");

let ownerAddressLowerCase = OWNER_ADDRESS.toLowerCase();

await replaceStringInFile(SKALE_TRACES_DIR + _traceFileName ,
Expand Down Expand Up @@ -402,6 +406,15 @@ async function verifyPrestateTraceAgainstGethTrace(_fileName: string) {
let key = difference.path![1];
if (address == ZERO_ADDRESS && key == "balance")
return;

if (address == "CALL.address" && key == "balance")
return;
}

if (difference.kind == "D" && difference.path!.length == 1) {
let address = difference.path![0];
if (address == ZERO_ADDRESS)
return;
}


Expand Down

0 comments on commit dcd700e

Please sign in to comment.