Skip to content

Commit

Permalink
fix: dummy block ctx without context func
Browse files Browse the repository at this point in the history
  • Loading branch information
djm07073 committed Nov 21, 2024
1 parent 9bcc1da commit 9a4f948
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions x/evm/keeper/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,13 @@ func (k Keeper) CreateEVM(ctx context.Context, caller common.Address, tracer *tr
vmConfig := vm.Config{Tracer: tracer, ExtraEips: extraEIPs, NumRetainBlockHashes: &params.NumRetainBlockHashes}

// use dummy block context for chain rules in EVM creation
dummyBlockContext, err := k.buildBlockContext(ctx, nil, fee)
if err != nil {
return ctx, nil, err
sdkCtx := sdk.UnwrapSDKContext(ctx)
dummyBlockContext := vm.BlockContext{
BlockNumber: big.NewInt(sdkCtx.BlockHeight()),
Random: (*common.Hash)(sdkCtx.HeaderHash()),
Time: uint64(sdkCtx.BlockTime().Unix()),
}

txContext, err := k.buildTxContext(ctx, caller, fee)
if err != nil {
return ctx, nil, err
Expand Down

0 comments on commit 9a4f948

Please sign in to comment.