Merge pull request #1 from openrelayxyz/develop

Develop
This commit is contained in:
philip-morlier 2021-09-09 10:07:01 -07:00 committed by GitHub
commit e94946bad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"math/big" "math/big"
"time" "time"
"github.com/holiman/uint256" "github.com/holiman/uint256"
) )
@ -58,7 +59,6 @@ type Backend interface {
// Engine() consensus.Engine // Engine() consensus.Engine
} }
type OpCode byte type OpCode byte
type TracerResult interface { type TracerResult interface {
@ -66,7 +66,34 @@ type TracerResult interface {
CaptureState(pc uint64, op OpCode, gas, cost uint64, scope ScopeContext, rData []byte, depth int, err error) CaptureState(pc uint64, op OpCode, gas, cost uint64, scope ScopeContext, rData []byte, depth int, err error)
CaptureFault(pc uint64, op OpCode, gas, cost uint64, scope ScopeContext, depth int, err error) CaptureFault(pc uint64, op OpCode, gas, cost uint64, scope ScopeContext, depth int, err error)
CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error)
Result() interface{} Result() (interface{}, error)
}
type StateDB interface {
GetBalance(Address) *big.Int
GetNonce(Address) uint64
GetCodeHash(Address) Hash
GetCode(Address) []byte
GetCodeSize(Address) int
GetRefund() uint64
GetCommittedState(Address, Hash) Hash
GetState(Address, Hash) Hash
HasSuicided(Address) bool
// Exist reports whether the given account exists in state.
// Notably this should also return true for suicided accounts.
Exist(Address) bool
// Empty returns whether the given account is empty. Empty
// is defined according to EIP161 (balance = nonce = code = 0).
Empty(Address) bool
AddressInAccessList(addr Address) bool
SlotInAccessList(addr Address, slot Hash) (addressOk bool, slotOk bool)
} }
type ScopeContext interface { type ScopeContext interface {
@ -90,16 +117,15 @@ type Contract interface {
GetOp(n uint64) OpCode GetOp(n uint64) OpCode
GetByte(n uint64) byte GetByte(n uint64) byte
Caller() Address Caller() Address
UseGas(gas uint64) (ok bool)
Address() Address Address() Address
Value() *big.Int Value() *big.Int
} }
type Downloader interface{ type Downloader interface {
Progress() Progress Progress() Progress
} }
type Progress interface{ type Progress interface {
StartingBlock() uint64 StartingBlock() uint64
CurrentBlock() uint64 CurrentBlock() uint64
HighestBlock() uint64 HighestBlock() uint64
@ -107,8 +133,7 @@ type Progress interface{
KnownStates() uint64 KnownStates() uint64
} }
type Node interface {
type Node interface{
Server() Server Server() Server
DataDir() string DataDir() string
InstanceDir() string InstanceDir() string
@ -118,12 +143,10 @@ type Node interface{
ResolvePath(x string) string ResolvePath(x string) string
} }
type Server interface {
type Server interface{
PeerCount() int PeerCount() int
} }
type Logger interface { type Logger interface {
Trace(string, ...interface{}) Trace(string, ...interface{})
Debug(string, ...interface{}) Debug(string, ...interface{})
@ -133,8 +156,6 @@ type Logger interface {
Error(string, ...interface{}) Error(string, ...interface{})
} }
type PluginLoader interface{ type PluginLoader interface {
Lookup(name string, validate func(interface{}) bool) []interface{} Lookup(name string, validate func(interface{}) bool) []interface{}
} }