base

package
v1.2.10-1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block interface {
	BlockVersionSpec
	module.Block
}

type BlockData

type BlockData interface {
	BlockVersionSpec
	module.BlockData
}

type BlockHandler

type BlockHandler interface {
	Version() int
	// propose or genesis
	NewBlock(
		height int64, ts int64, proposer module.Address, prev module.Block,
		logsBloom module.LogsBloom, result []byte,
		patchTransactions module.TransactionList,
		normalTransactions module.TransactionList,
		nextValidators module.ValidatorList, votes module.CommitVoteSet,
	) Block
	NewBlockFromHeaderReader(r io.Reader) (Block, error)
	NewBlockDataFromReader(io.Reader) (BlockData, error)
	GetBlock(id []byte) (Block, error)
}

type BlockHandlerContext

type BlockHandlerContext interface {
	GetBlockByHeight(height int64) (module.Block, error)
}

type BlockVersionSpec

type BlockVersionSpec interface {
	FinalizeHeader(dbase db.Database) error
	// GetVoters returns the voters for the block. Note that this is different
	// from the voted, which is a subset of the voters.
	GetVoters(ctx BlockHandlerContext) (module.ValidatorList, error)
	// VerifyTimestamp verifies timestamp of the block.
	VerifyTimestamp(prev module.BlockData, prevVoters module.ValidatorList) error
}

type Chain

type Chain interface {
	Database() db.Database
	CommitVoteSetDecoder() module.CommitVoteSetDecoder
	ServiceManager() module.ServiceManager
	MetricContext() context.Context
	CID() int
	NID() int
	Logger() log.Logger
	NetworkManager() module.NetworkManager
	BlockManager() module.BlockManager
	Regulator() module.Regulator
	Wallet() module.Wallet
}

type ExecutionResult

type ExecutionResult interface {
	PatchReceipts() module.ReceiptList
	NormalReceipts() module.ReceiptList
	TotalFee() *big.Int
	VirtualFee() *big.Int
}

type Platform

type Platform interface {
	NewContractManager(dbase db.Database, dir string, logger log.Logger) (contract.ContractManager, error)
	NewExtensionSnapshot(dbase db.Database, raw []byte) state.ExtensionSnapshot
	NewExtensionWithBuilder(builder merkle.Builder, raw []byte) state.ExtensionSnapshot
	OnExtensionSnapshotFinalization(ess state.ExtensionSnapshot, logger log.Logger)
	ToRevision(value int) module.Revision
	NewBaseTransaction(wc state.WorldContext) (module.Transaction, error)
	OnValidateTransactions(wc state.WorldContext, patches, txs module.TransactionList) error
	OnExecutionBegin(wc state.WorldContext, logger log.Logger) error
	OnExecutionEnd(wc state.WorldContext, er ExecutionResult, logger log.Logger) error
	OnTransactionEnd(wc state.WorldContext, logger log.Logger, rct txresult.Receipt) error
	DefaultBlockVersionFor(cid int) int
	NewBlockHandlers(c Chain) []BlockHandler
	NewConsensus(c Chain, walDir string) (module.Consensus, error)
	CommitVoteSetDecoder() module.CommitVoteSetDecoder
	Term()
}

Jump to

Keyboard shortcuts

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