Removed UseGas method from Contract interface
This commit is contained in:
parent
b7b64de53a
commit
1fb2754193
@ -1,10 +1,11 @@
|
|||||||
package core
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"math/big"
|
"math/big"
|
||||||
"time"
|
"time"
|
||||||
"github.com/holiman/uint256"
|
|
||||||
|
"github.com/holiman/uint256"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Backend interface {
|
type Backend interface {
|
||||||
@ -23,10 +24,10 @@ type Backend interface {
|
|||||||
HeaderByNumber(ctx context.Context, number int64) ([]byte, error) // RLP encoded header
|
HeaderByNumber(ctx context.Context, number int64) ([]byte, error) // RLP encoded header
|
||||||
HeaderByHash(ctx context.Context, hash Hash) ([]byte, error)
|
HeaderByHash(ctx context.Context, hash Hash) ([]byte, error)
|
||||||
// HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)
|
// HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)
|
||||||
CurrentHeader() []byte // RLP encoded header
|
CurrentHeader() []byte // RLP encoded header
|
||||||
CurrentBlock() []byte // RLP encoded block
|
CurrentBlock() []byte // RLP encoded block
|
||||||
BlockByNumber(ctx context.Context, number int64) ([]byte, error) // RLP encoded block
|
BlockByNumber(ctx context.Context, number int64) ([]byte, error) // RLP encoded block
|
||||||
BlockByHash(ctx context.Context, hash Hash) ([]byte, error) // RLP encoded block
|
BlockByHash(ctx context.Context, hash Hash) ([]byte, error) // RLP encoded block
|
||||||
// BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)
|
// BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)
|
||||||
// StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error)
|
// StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error)
|
||||||
// StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)
|
// StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)
|
||||||
@ -38,10 +39,10 @@ type Backend interface {
|
|||||||
SubscribeChainSideEvent(ch chan<- ChainSideEvent) Subscription
|
SubscribeChainSideEvent(ch chan<- ChainSideEvent) Subscription
|
||||||
|
|
||||||
// Transaction pool API
|
// Transaction pool API
|
||||||
SendTx(ctx context.Context, signedTx []byte) error // RLP Encoded Transaction
|
SendTx(ctx context.Context, signedTx []byte) error // RLP Encoded Transaction
|
||||||
GetTransaction(ctx context.Context, txHash Hash) ([]byte, Hash, uint64, uint64, error) // RLP Encoded transaction
|
GetTransaction(ctx context.Context, txHash Hash) ([]byte, Hash, uint64, uint64, error) // RLP Encoded transaction
|
||||||
GetPoolTransactions() ([][]byte, error) // []RLP ecnoded transactions
|
GetPoolTransactions() ([][]byte, error) // []RLP ecnoded transactions
|
||||||
GetPoolTransaction(txHash Hash) []byte // RLP encoded transaction
|
GetPoolTransaction(txHash Hash) []byte // RLP encoded transaction
|
||||||
GetPoolNonce(ctx context.Context, addr Address) (uint64, error)
|
GetPoolNonce(ctx context.Context, addr Address) (uint64, error)
|
||||||
Stats() (pending int, queued int)
|
Stats() (pending int, queued int)
|
||||||
TxPoolContent() (map[Address][][]byte, map[Address][][]byte) // RLP encoded transactions
|
TxPoolContent() (map[Address][][]byte, map[Address][][]byte) // RLP encoded transactions
|
||||||
@ -50,15 +51,14 @@ type Backend interface {
|
|||||||
// Filter API
|
// Filter API
|
||||||
BloomStatus() (uint64, uint64)
|
BloomStatus() (uint64, uint64)
|
||||||
GetLogs(ctx context.Context, blockHash Hash) ([][]byte, error) // []RLP encoded logs
|
GetLogs(ctx context.Context, blockHash Hash) ([][]byte, error) // []RLP encoded logs
|
||||||
SubscribeLogsEvent(ch chan<- [][]byte) Subscription // []RLP encoded logs
|
SubscribeLogsEvent(ch chan<- [][]byte) Subscription // []RLP encoded logs
|
||||||
SubscribePendingLogsEvent(ch chan<- [][]byte) Subscription // RLP Encoded logs
|
SubscribePendingLogsEvent(ch chan<- [][]byte) Subscription // RLP Encoded logs
|
||||||
SubscribeRemovedLogsEvent(ch chan<- []byte) Subscription // RLP encoded logs
|
SubscribeRemovedLogsEvent(ch chan<- []byte) Subscription // RLP encoded logs
|
||||||
|
|
||||||
// ChainConfig() *params.ChainConfig
|
// ChainConfig() *params.ChainConfig
|
||||||
// Engine() consensus.Engine
|
// Engine() consensus.Engine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type OpCode byte
|
type OpCode byte
|
||||||
|
|
||||||
type TracerResult interface {
|
type TracerResult interface {
|
||||||
@ -70,71 +70,65 @@ type TracerResult interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ScopeContext interface {
|
type ScopeContext interface {
|
||||||
Memory() Memory
|
Memory() Memory
|
||||||
Stack() Stack
|
Stack() Stack
|
||||||
Contract() Contract
|
Contract() Contract
|
||||||
}
|
}
|
||||||
|
|
||||||
type Memory interface {
|
type Memory interface {
|
||||||
GetCopy(int64, int64) []byte
|
GetCopy(int64, int64) []byte
|
||||||
Len() int
|
Len() int
|
||||||
}
|
}
|
||||||
|
|
||||||
type Stack interface {
|
type Stack interface {
|
||||||
Back(n int) *uint256.Int
|
Back(n int) *uint256.Int
|
||||||
Len() int
|
Len() int
|
||||||
}
|
}
|
||||||
|
|
||||||
type Contract interface {
|
type Contract interface {
|
||||||
AsDelegate() Contract
|
AsDelegate() Contract
|
||||||
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
|
||||||
PulledStates() uint64
|
PulledStates() uint64
|
||||||
KnownStates() uint64
|
KnownStates() uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Node interface {
|
||||||
type Node interface{
|
Server() Server
|
||||||
Server() Server
|
DataDir() string
|
||||||
DataDir() string
|
InstanceDir() string
|
||||||
InstanceDir() string
|
IPCEndpoint() string
|
||||||
IPCEndpoint() string
|
HTTPEndpoint() string
|
||||||
HTTPEndpoint() string
|
WSEndpoint() string
|
||||||
WSEndpoint() string
|
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{})
|
||||||
Info(string, ...interface{})
|
Info(string, ...interface{})
|
||||||
Warn(string, ...interface{})
|
Warn(string, ...interface{})
|
||||||
Crit(string, ...interface{})
|
Crit(string, ...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{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user