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 17, 2024
1 parent d620e7c commit 940d5dc
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"0x0000000000000000000000000000000000000000": {
"balance": "0x4175fce"
"balance": "0x439f07a"
},
"Tracer.address": {
"balance": "0x0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"type": "call"
}
],
"transactionHash": "0xe5177dfa1621a9f864667f67a81e49d754230181ebd69de7d0e544b030ed5921",
"transactionHash": "0x58aa03e29bf344b31f0e65d3f28ce2d5cab1159795083ad942f1d57f42a5e6f2",
"vmTrace": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"post": {
"0x0000000000000000000000000000000000000000": {
"balance": "0x4175fce"
"balance": "0x439f07a"
},
"0x388c818ca8b9251b393131c08a736a67ccb19297": {
"balance": "0xf43fc2c04ee0000"
"balance": "0x14d1120d7b160000"
},
"0x907cd0881e50d359bb9fd120b1a5a143b1c97de6": {
"balance": "0x35b4b3304e4507690f",
"nonce": 343
"balance": "0x35a999048b57805303",
"nonce": 359
}
},
"pre": {
"0x0000000000000000000000000000000000000000": {
"balance": "0x4170dc6"
"balance": "0x4399e72"
},
"0x388c818ca8b9251b393131c08a736a67ccb19297": {
"balance": "0xde0b6b3a7640000"
"balance": "0x136dcc951d8c0000"
},
"0x907cd0881e50d359bb9fd120b1a5a143b1c97de6": {
"balance": "0x35b61675c6a2944b57",
"nonce": 342
"balance": "0x35aafc4a03b50d354b",
"nonce": 358
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"0x0000000000000000000000000000000000000000": {
"balance": "0x4170dc6"
"balance": "0x4399e72"
},
"0x388c818ca8b9251b393131c08a736a67ccb19297": {
"balance": "0xde0b6b3a7640000"
"balance": "0x136dcc951d8c0000"
},
"0x907cd0881e50d359bb9fd120b1a5a143b1c97de6": {
"balance": "0x35b61675c6a2944b57",
"nonce": 342
"balance": "0x35aafc4a03b50d354b",
"nonce": 358
}
}
7 changes: 5 additions & 2 deletions test/historicstate/hardhat/scripts/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let DEFAULT_TRACER = "defaultTracer";
let CALL_TRACER = "callTracer";
let PRESTATE_TRACER = "prestateTracer";
let PRESTATEDIFF_TRACER = "prestateDiffTracer";
let FOUR_BYTE_TRACER = "4byteTracer";
let FOURBYTE_TRACER = "4byteTracer";
let REPLAY_TRACER = "replayTracer"


Expand All @@ -46,6 +46,7 @@ const TEST_TRANSFER_DEFAULTTRACER_FILE_NAME = TEST_CONTRACT_NAME + ".transfer.de
const TEST_TRANSFER_CALLTRACER_FILE_NAME = TEST_CONTRACT_NAME + ".transfer.callTracer.json";
const TEST_TRANSFER_PRESTATETRACER_FILE_NAME = TEST_CONTRACT_NAME + ".transfer.prestateTracer.json";
const TEST_TRANSFER_PRESTATEDIFFTRACER_FILE_NAME = TEST_CONTRACT_NAME + ".transfer.prestateDiffTracer.json";
const TEST_TRANSFER_FOURBYTETRACER_FILE_NAME = TEST_CONTRACT_NAME + ".transfer.4byteTracer.json";


const TEST_CONTRACT_CALL_DEFAULTTRACER_FILE_NAME = TEST_CONTRACT_NAME + "." + CALL_FUNCTION_NAME + ".defaultTracer.json";
Expand Down Expand Up @@ -666,6 +667,7 @@ async function main(): Promise<void> {

const transferHash: string = await callTestContractRun(deployedContract);

await getAndPrintCommittedTransactionTrace(transferHash, FOURBYTE_TRACER, TEST_TRANSFER_FOURBYTETRACER_FILE_NAME);
await getAndPrintCommittedTransactionTrace(transferHash, PRESTATEDIFF_TRACER, TEST_TRANSFER_PRESTATEDIFFTRACER_FILE_NAME);
await getAndPrintCommittedTransactionTrace(transferHash, PRESTATE_TRACER, TEST_TRANSFER_PRESTATETRACER_FILE_NAME);
await getAndPrintCommittedTransactionTrace(transferHash, PRESTATE_TRACER, TEST_TRANSFER_PRESTATETRACER_FILE_NAME);
Expand All @@ -674,7 +676,7 @@ async function main(): Promise<void> {

await callDebugTraceCall(deployedContract, DEFAULT_TRACER, TEST_CONTRACT_CALL_DEFAULTTRACER_FILE_NAME);
await callDebugTraceCall(deployedContract, CALL_TRACER, TEST_CONTRACT_CALL_CALLTRACER_FILE_NAME);
await callDebugTraceCall(deployedContract, FOUR_BYTE_TRACER, TEST_CONTRACT_CALL_FOURBYTETRACER_FILE_NAME);
await callDebugTraceCall(deployedContract, FOURBYTE_TRACER, TEST_CONTRACT_CALL_FOURBYTETRACER_FILE_NAME);
await callDebugTraceCall(deployedContract, PRESTATE_TRACER, TEST_CONTRACT_CALL_PRESTATETRACER_FILE_NAME);
await callDebugTraceCall(deployedContract, PRESTATEDIFF_TRACER, TEST_CONTRACT_CALL_PRESTATEDIFFTRACER_FILE_NAME);

Expand All @@ -684,6 +686,7 @@ async function main(): Promise<void> {
await callDebugTraceCall(deployedContract, REPLAY_TRACER, TEST_CONTRACT_CALL_REPLAYTRACER_FILE_NAME);
}

await verifyTransferTraceAgainstGethTrace(TEST_TRANSFER_FOURBYTETRACER_FILE_NAME);
await verifyPrestateDiffTransferTraceAgainstGethTrace(TEST_TRANSFER_PRESTATEDIFFTRACER_FILE_NAME);
await verifyPrestateTransferTraceAgainstGethTrace(TEST_TRANSFER_PRESTATETRACER_FILE_NAME);
await verifyTransferTraceAgainstGethTrace(TEST_TRANSFER_DEFAULTTRACER_FILE_NAME);
Expand Down

0 comments on commit 940d5dc

Please sign in to comment.