Skip to content

Commit

Permalink
Merge pull request ethereum#262 from OffchainLabs/fix_apibackend
Browse files Browse the repository at this point in the history
arbitrum apiBackend: GetEVM handles nil blockContext
  • Loading branch information
PlasmaPower committed Oct 24, 2023
2 parents 2eaa152 + 09e94e7 commit c2a3d37
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 c2a3d37

Please sign in to comment.