|
|
|
@ -27,9 +27,8 @@ import ( |
|
|
|
|
// implementations:
|
|
|
|
|
// * hmy/api_backend.go
|
|
|
|
|
type Backend interface { |
|
|
|
|
// NOTE(ricl): this is not in ETH Backend inteface. They put it directly in eth object.
|
|
|
|
|
NetVersion() uint64 |
|
|
|
|
// General Ethereum API
|
|
|
|
|
|
|
|
|
|
// Downloader() *downloader.Downloader
|
|
|
|
|
ProtocolVersion() int |
|
|
|
|
// SuggestPrice(ctx context.Context) (*big.Int, error)
|
|
|
|
@ -38,14 +37,13 @@ type Backend interface { |
|
|
|
|
AccountManager() *accounts.Manager |
|
|
|
|
// ExtRPCEnabled() bool
|
|
|
|
|
RPCGasCap() *big.Int // global gas cap for hmy_call over rpc: DoS protection
|
|
|
|
|
// BlockChain API
|
|
|
|
|
// SetHead(number uint64)
|
|
|
|
|
|
|
|
|
|
HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*block.Header, error) |
|
|
|
|
BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error) |
|
|
|
|
StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.DB, *block.Header, error) |
|
|
|
|
GetBlock(ctx context.Context, blockHash common.Hash) (*types.Block, error) |
|
|
|
|
GetReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error) |
|
|
|
|
// GetTd(blockHash common.Hash) *big.Int
|
|
|
|
|
|
|
|
|
|
GetEVM(ctx context.Context, msg core.Message, state *state.DB, header *block.Header) (*vm.EVM, func() error, error) |
|
|
|
|
SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription |
|
|
|
|
SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription |
|
|
|
@ -90,4 +88,5 @@ type Backend interface { |
|
|
|
|
GetTotalStakingSnapshot() *big.Int |
|
|
|
|
GetCurrentBadBlocks() []core.BadBlock |
|
|
|
|
GetLastCrossLinks() ([]*types.CrossLink, error) |
|
|
|
|
GetLatestChainHeaders() *block.HeaderPair |
|
|
|
|
} |
|
|
|
|