consensus

package
v0.0.0-...-91a82d4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownBlock = errors.New("unknown block")

	ErrUnknownAncestor = errors.New("unknown ancestor")

	ErrFutureBlock = errors.New("block in the future")

	ErrInvalidNumber = errors.New("invalid block number")
)

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Author(header *types.BlockHeader) (utils.Address, error) //Delete

	CalcDifficulty(chain IChainReader, config *params.ChainConfig, time uint64, parent *types.BlockHeader) *big.Int

	VerifySeal(chain IChainReader, header *types.BlockHeader) error

	Seal(chain IChainReader, block *types.Block, stop <-chan struct{}, threads int, updateHashes chan uint64) (*types.Block, error)

	Finalize(chain IChainReader, header *types.BlockHeader, state *state.StateDB, txs []*types.Transaction, actions []*types.Action, receipts []*types.Receipt, dposContext *types.DposContext) (*types.Block, error)
}

type IBlockChain

type IBlockChain interface {
	SubscribeChainBlockEvent(ch chan<- feed.BlockAndLogsEvent) feed.Subscription
	PostEvent(event interface{})
	GetCurrentInfo() (*types.Block, *state.StateDB, error)
	WriteBlockWithState(*types.Block, types.Receipts, *state.StateDB) (bool, error)
	ExecActions(statedb *state.StateDB, actions []*types.Action)
	ExecTransaction(*utils.Address, *types.DposContext, *utils.GasPool, *state.StateDB, *types.BlockHeader, *types.Transaction, *uint64, vm.Config) ([]byte, *types.Receipt, uint64, error)
}

type IChainReader

type IChainReader interface {
	Config() *params.ChainConfig
	CurrentBlock() *types.Block
	GetHeader(hash utils.Hash) *types.BlockHeader
	GetBlockByHeight(uint64) *types.Block
	GetBlockByHash(utils.Hash) *types.Block
}

type ITxPool

type ITxPool interface {
	Pending() (map[utils.Address]types.Transactions, error)
	Actions() []*types.Action
	SubscribeNewTxsEvent(ch chan<- feed.NewTxsEvent) feed.Subscription
}

type IUranus

type IUranus interface {
	ITxPool
	IBlockChain
	IChainReader
}

Directories

Path Synopsis
pow

Jump to

Keyboard shortcuts

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