protocol

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2019 License: LGPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainDB

type ChainDB interface {
	SizeOfValue(hash common.Hash) (int, error)

	SetBlock(hash common.Hash, block *types.Block) error
	GetBlock(hash common.Hash, height uint32) (*types.Block, error)
	GetBlockByHeight(height uint32) (*types.Block, error)
	GetBlockByHash(hash common.Hash) (*types.Block, error)
	IsExistByHash(hash common.Hash) (bool, error)

	GetConfirms(hash common.Hash) ([]types.SignData, error)
	SetConfirm(hash common.Hash, signData types.SignData) error
	SetConfirms(hash common.Hash, pack []types.SignData) error

	LoadLatestBlock() (*types.Block, error)
	SetStableBlock(hash common.Hash) error

	GetAccount(addr common.Address) (*types.AccountData, error)

	GetTrieDatabase() *store.TrieDatabase
	GetActDatabase(hash common.Hash) (*store.AccountTrieDB, error)

	GetContractCode(hash common.Hash) (types.Code, error)
	SetContractCode(hash common.Hash, code types.Code) error

	CandidatesRanking(hash common.Hash)
	GetCandidatesTop(hash common.Hash) []*store.Candidate

	GetAssetID(id common.Hash) (common.Address, error)
	GetAssetCode(code common.Hash) (common.Address, error)

	ChooseUnConfirmBlock(compareFn func(*types.Block, *types.Block) *types.Block) *types.Block

	Close() error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL