mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Merge pull request #13 from sei-protocol/evm-set-evm
Set EVM in StateDB in gasestimator
This commit is contained in:
commit
c047698e66
3 changed files with 4 additions and 0 deletions
|
|
@ -1389,6 +1389,8 @@ func (s *StateDB) convertAccountSet(set map[common.Address]*types.StateAccount)
|
|||
return ret
|
||||
}
|
||||
|
||||
func (s *StateDB) SetEVM(evm *vm.EVM) {}
|
||||
|
||||
// copySet returns a deep-copied set.
|
||||
func copySet[k comparable](set map[k][]byte) map[k][]byte {
|
||||
copied := make(map[k][]byte, len(set))
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ type StateDB interface {
|
|||
GetLogs(hash common.Hash, blockNumber uint64, blockHash common.Hash) []*types.Log
|
||||
TxIndex() int
|
||||
Preimages() map[common.Hash][]byte
|
||||
SetEVM(evm *EVM)
|
||||
}
|
||||
|
||||
// CallContext provides a basic interface for the EVM calling conventions. The EVM
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ func run(ctx context.Context, call *core.Message, opts *Options) (*core.Executio
|
|||
dirtyState = opts.State.Copy()
|
||||
evm = vm.NewEVM(evmContext, msgContext, dirtyState, opts.Config, vm.Config{NoBaseFee: true})
|
||||
)
|
||||
dirtyState.SetEVM(evm)
|
||||
// Monitor the outer context and interrupt the EVM upon cancellation. To avoid
|
||||
// a dangling goroutine until the outer estimation finishes, create an internal
|
||||
// context for the lifetime of this method call.
|
||||
|
|
|
|||
Loading…
Reference in a new issue