Skip to content

Commit

Permalink
fix missed NewMessage*Mode -> NewMessage*Context renames
Browse files Browse the repository at this point in the history
  • Loading branch information
magicxyyz committed Nov 13, 2024
1 parent 7fb544d commit acab6d3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
rejectedTxs = append(rejectedTxs, &rejectedTx{i, errMsg})
continue
}
msg, err := core.TransactionToMessage(tx, signer, pre.Env.BaseFee, core.NewMessageCommitMode(nil)) // TODO: do we need to specify wasm targets here if chainConfig.IsArbitrum == false?
msg, err := core.TransactionToMessage(tx, signer, pre.Env.BaseFee, core.NewMessageCommitContext(nil)) // TODO: do we need to specify wasm targets here if chainConfig.IsArbitrum == false?
if err != nil {
log.Warn("rejected tx", "index", i, "hash", tx.Hash(), "error", err)
rejectedTxs = append(rejectedTxs, &rejectedTx{i, err.Error()})
Expand Down
2 changes: 1 addition & 1 deletion eth/tracers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (b *testBackend) StateAtTransaction(ctx context.Context, block *types.Block
}
// Recompute transactions up to the target index.
signer := types.MakeSigner(b.chainConfig, block.Number(), block.Time())
runCtx := core.NewMessageReplayMode([]ethdb.WasmTarget{rawdb.LocalTarget()})
runCtx := core.NewMessageReplayContext([]ethdb.WasmTarget{rawdb.LocalTarget()})
for idx, tx := range block.Transactions() {
msg, _ := core.TransactionToMessage(tx, signer, block.BaseFee(), runCtx)
txContext := core.NewEVMTxContext(msg)
Expand Down
6 changes: 3 additions & 3 deletions eth/tracers/internal/tracetest/calltrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func testCallTracer(tracerName string, dirPath string, t *testing.T) {
}

state.StateDB.SetLogger(tracer.Hooks)
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayMode([]ethdb.WasmTarget{rawdb.LocalTarget()}))
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayContext([]ethdb.WasmTarget{rawdb.LocalTarget()}))
if err != nil {
t.Fatalf("failed to prepare transaction for tracing: %v", err)
}
Expand Down Expand Up @@ -231,7 +231,7 @@ func benchTracer(tracerName string, test *callTracerTest, b *testing.B) {
Difficulty: (*big.Int)(test.Context.Difficulty),
GasLimit: uint64(test.Context.GasLimit),
}
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayMode([]ethdb.WasmTarget{rawdb.LocalTarget()}))
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayContext([]ethdb.WasmTarget{rawdb.LocalTarget()}))
if err != nil {
b.Fatalf("failed to prepare transaction for tracing: %v", err)
}
Expand Down Expand Up @@ -388,7 +388,7 @@ func TestInternals(t *testing.T) {
GasPrice: tx.GasPrice(),
}
evm := vm.NewEVM(context, txContext, state.StateDB, config, vm.Config{Tracer: tc.tracer.Hooks})
msg, err := core.TransactionToMessage(tx, signer, big.NewInt(0), core.NewMessageReplayMode([]ethdb.WasmTarget{rawdb.LocalTarget()}))
msg, err := core.TransactionToMessage(tx, signer, big.NewInt(0), core.NewMessageReplayContext([]ethdb.WasmTarget{rawdb.LocalTarget()}))
if err != nil {
t.Fatalf("test %v: failed to create message: %v", tc.name, err)
}
Expand Down
2 changes: 1 addition & 1 deletion eth/tracers/internal/tracetest/flat_calltrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func flatCallTracerTestRunner(tracerName string, filename string, dirPath string
}

state.StateDB.SetLogger(tracer.Hooks)
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayMode([]ethdb.WasmTarget{rawdb.LocalTarget()}))
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayContext([]ethdb.WasmTarget{rawdb.LocalTarget()}))
if err != nil {
return fmt.Errorf("failed to prepare transaction for tracing: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion eth/tracers/internal/tracetest/prestate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func testPrestateDiffTracer(tracerName string, dirPath string, t *testing.T) {
}

state.StateDB.SetLogger(tracer.Hooks)
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayMode([]ethdb.WasmTarget{rawdb.LocalTarget()}))
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayContext([]ethdb.WasmTarget{rawdb.LocalTarget()}))
if err != nil {
t.Fatalf("failed to prepare transaction for tracing: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion eth/tracers/tracers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func BenchmarkTransactionTrace(b *testing.B) {
//EnableReturnData: false,
})
evm := vm.NewEVM(context, txContext, state.StateDB, params.AllEthashProtocolChanges, vm.Config{Tracer: tracer.Hooks()})
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayMode([]ethdb.WasmTarget{rawdb.LocalTarget()}))
msg, err := core.TransactionToMessage(tx, signer, context.BaseFee, core.NewMessageReplayContext([]ethdb.WasmTarget{rawdb.LocalTarget()}))
if err != nil {
b.Fatalf("failed to prepare transaction for tracing: %v", err)
}
Expand Down

0 comments on commit acab6d3

Please sign in to comment.