mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-21 14:14:30 +00:00
25 lines
No EOL
622 B
Go
25 lines
No EOL
622 B
Go
package validator
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/ethereum/go-ethereum/core"
|
|
"github.com/ethereum/go-ethereum/core/vm"
|
|
)
|
|
|
|
func NewEnv(cfg *Config) *vm.EVM {
|
|
context := vm.Context{
|
|
CanTransfer: core.CanTransfer,
|
|
Transfer: core.Transfer,
|
|
GetHash: func(uint64) common.Hash { return common.Hash{} },
|
|
|
|
Origin: cfg.Origin,
|
|
Coinbase: cfg.Coinbase,
|
|
BlockNumber: cfg.BlockNumber,
|
|
Time: cfg.Time,
|
|
Difficulty: cfg.Difficulty,
|
|
GasLimit: cfg.GasLimit,
|
|
GasPrice: cfg.GasPrice,
|
|
}
|
|
|
|
return vm.NewEVM(context, cfg.State, cfg.ChainConfig, cfg.EVMConfig)
|
|
} |