Skip to content

Commit

Permalink
eth: return state error via GetEVM (#25876)
Browse files Browse the repository at this point in the history
* make vmError more useful

* fix for review

* Update api.go

* revert calling site

Co-authored-by: rjl493456442 <[email protected]>
  • Loading branch information
zhiqiangxu and rjl493456442 authored Sep 27, 2022
1 parent bff84a9 commit 13e6985
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions eth/api_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,12 @@ func (b *EthAPIBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int {
}

func (b *EthAPIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config) (*vm.EVM, func() error, error) {
vmError := func() error { return nil }
if vmConfig == nil {
vmConfig = b.eth.blockchain.GetVMConfig()
}
txContext := core.NewEVMTxContext(msg)
context := core.NewEVMBlockContext(header, b.eth.BlockChain(), nil)
return vm.NewEVM(context, txContext, state, b.eth.blockchain.Config(), *vmConfig), vmError, nil
return vm.NewEVM(context, txContext, state, b.eth.blockchain.Config(), *vmConfig), state.Error, nil
}

func (b *EthAPIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
Expand Down

0 comments on commit 13e6985

Please sign in to comment.