mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 13:44:31 +00:00
Co-authored-by: Aaron Chen <aaronchen.lisp@gmail.com>
This commit is contained in:
parent
bb458d0eed
commit
b896f4dce1
2 changed files with 4 additions and 13 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"slices"
|
||||
|
||||
"github.com/XinFinOrg/XDPoSChain/common"
|
||||
"github.com/XinFinOrg/XDPoSChain/common/hexutil"
|
||||
|
|
@ -528,13 +529,7 @@ func (t *jsTracer) setBuiltinFunctions() {
|
|||
vm.Interrupt(err)
|
||||
return false
|
||||
}
|
||||
addr := common.BytesToAddress(a)
|
||||
for _, p := range t.activePrecompiles {
|
||||
if p == addr {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(t.activePrecompiles, common.BytesToAddress(a))
|
||||
})
|
||||
vm.Set("slice", func(slice goja.Value, start, end int64) goja.Value {
|
||||
b, err := t.fromBuf(vm, slice, false)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/XinFinOrg/XDPoSChain/common"
|
||||
|
|
@ -228,12 +229,7 @@ func (t *flatCallTracer) Stop(err error) {
|
|||
|
||||
// isPrecompiled returns whether the addr is a precompile.
|
||||
func (t *flatCallTracer) isPrecompiled(addr common.Address) bool {
|
||||
for _, p := range t.activePrecompiles {
|
||||
if p == addr {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(t.activePrecompiles, addr)
|
||||
}
|
||||
|
||||
func flatFromNested(input *callFrame, traceAddress []int, convertErrs bool, ctx *tracers.Context) (output []flatCallFrame, err error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue