Skip to content

Commit

Permalink
arbitrum apiBackend: GetEVM handles nil blokContext
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Oct 18, 2023
1 parent 5d9bb83 commit 4fc6ae8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arbitrum/apibackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,13 @@ func (a *APIBackend) GetEVM(ctx context.Context, msg *core.Message, state *state
vmConfig = a.BlockChain().GetVMConfig()
}
txContext := core.NewEVMTxContext(msg)
return vm.NewEVM(*blockCtx, txContext, state, a.BlockChain().Config(), *vmConfig), vmError
var context vm.BlockContext
if blockCtx != nil {
context = *blockCtx
} else {
context = core.NewEVMBlockContext(header, a.BlockChain(), nil)
}
return vm.NewEVM(context, txContext, state, a.BlockChain().Config(), *vmConfig), vmError
}

func (a *APIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription {
Expand Down

0 comments on commit 4fc6ae8

Please sign in to comment.