mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-14 07:53:47 +00:00
Added IsPrecompileAddr on EVM to let tracer easily determine if an address is a precompiled address
This commit is contained in:
parent
b9bcdef066
commit
d723124530
1 changed files with 5 additions and 0 deletions
|
|
@ -38,6 +38,11 @@ type (
|
||||||
GetHashFunc func(uint64) common.Hash
|
GetHashFunc func(uint64) common.Hash
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (evm *EVM) IsPrecompileAddr(addr common.Address) bool {
|
||||||
|
_, isPrecompile := evm.precompile(addr)
|
||||||
|
return isPrecompile
|
||||||
|
}
|
||||||
|
|
||||||
func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) {
|
func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) {
|
||||||
var precompiles map[common.Address]PrecompiledContract
|
var precompiles map[common.Address]PrecompiledContract
|
||||||
switch {
|
switch {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue