block

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResultNotFinalizedError = errors.CodeBlock + iota
)

Variables

View Source
var (
	ErrResultNotFinalized = errors.NewBase(ResultNotFinalizedError, "ResultNotFinalized")
)

Functions

func GetLastHeight added in v0.9.4

func GetLastHeight(dbase db.Database) (int64, error)

func GetLastHeightOf

func GetLastHeightOf(dbase db.Database) int64

func NewManager

func NewManager(
	chain module.Chain,
	timestamper module.Timestamper,
	handler Handler,
) (module.BlockManager, error)

NewManager creates BlockManager.

func ResetDB added in v0.9.4

func ResetDB(d db.Database, height int64) error

func WriteTransactionLocators added in v0.9.7

func WriteTransactionLocators(
	dbase db.Database,
	height int64,
	ptl module.TransactionList,
	ntl module.TransactionList,
) error

Types

type Handler added in v0.9.6

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

func NewBlockV2Handler added in v0.9.6

func NewBlockV2Handler(chain module.Chain) Handler

type RefCounter

type RefCounter interface {
	RefCount() int
}

type RefTracer

type RefTracer struct {
	Logger log.Logger
	// contains filtered or unexported fields
}

func (*RefTracer) TraceDispose

func (rt *RefTracer) TraceDispose(rc RefCounter)

func (*RefTracer) TraceNew

func (rt *RefTracer) TraceNew(rc RefCounter)

func (*RefTracer) TraceRef

func (rt *RefTracer) TraceRef(rc RefCounter)

func (*RefTracer) TraceUnref

func (rt *RefTracer) TraceUnref(rc RefCounter)

Jump to

Keyboard shortcuts

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