builder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractBlockBuilder

type AbstractBlockBuilder interface {
	BuildWaitPackBlock(coinbaseAddr common.Address) model.AbstractBlock
}

type BftBlockBuilder

type BftBlockBuilder struct {
	//nodeContext NodeContext
	ModelConfig
}

func MakeBftBlockBuilder

func MakeBftBlockBuilder(config ModelConfig) *BftBlockBuilder

context must have chainReader state_processor.ChainReader, stateProcessorBuilder stateProcessorBuilder, accountStorage state_processor.StateStorage, txPool txPool

func (*BftBlockBuilder) BuildWaitPackBlock

func (builder *BftBlockBuilder) BuildWaitPackBlock(coinbaseAddr common.Address) model.AbstractBlock

build the wait-pack block

func (*BftBlockBuilder) GetDifficulty

func (builder *BftBlockBuilder) GetDifficulty() common.Difficulty

type Chain

type Chain interface {
	CurrentBlock() model.AbstractBlock
	GetBlockByNumber(number uint64) model.AbstractBlock
	GetVerifiers(round uint64) []common.Address
	StateAtByBlockNumber(num uint64) (*state_processor.AccountStateDB, error)

	IsChangePoint(block model.AbstractBlock, isProcessPackageBlock bool) bool
	GetLastChangePoint(block model.AbstractBlock) *uint64
	GetSlot(block model.AbstractBlock) *uint64
	GetSeenCommit(height uint64) []model.AbstractVerification
	GetLatestNormalBlock() model.AbstractBlock

	BlockProcessor(root common.Hash) (*chain.BlockProcessor, error)
	BuildRegisterProcessor(preRoot common.Hash) (*registerdb.RegisterDB, error)
	GetEconomyModel() economy_model.EconomyModel
}

type ModelConfig

type ModelConfig struct {
	ChainReader        Chain
	TxPool             TxPool
	PriorityCalculator model.PriofityCalculator
	TxSigner           model.Signer
	MsgSigner          chain_communication.PbftSigner
	ChainConfig        chain_config.ChainConfig
}

type TxPool

type TxPool interface {
	RemoveTxs(newBlock model.AbstractBlock)
	Pending() (map[common.Address][]model.AbstractTransaction, error)

	Reset(oldHead, newHead *model.Header)
}

Jump to

Keyboard shortcuts

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