istate

package
v0.0.0-...-4f0ab6e Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LedgerStateManager

type LedgerStateManager interface {

	// LedgerInfo returns the last updated ledger info.
	LedgerInfo() *wire.LedgerInfo

	// LocalLedgerInfo returns the current local ledger.
	LocalLedgerInfo() *wire.LedgerInfo

	// GetLedgerRoot returns state's merkle tree's root hash.
	GetLedgerRoot() merkle.MerkleHash

	// GetShardHeight returns the height of the specific shrad.
	GetShardHeight(shardIndex shard.Index) int64

	// GetNewUpdate returns a temporary StateUpdate instance which can verify tx or block quickly.
	NewUpdate() (*state.Update, error)

	// ApplyUpdate apply a new update to state.
	ApplyUpdate(update *state.Update) error

	// GetUpdateWithFullBlock is similar to UpdateWithFullBlock, but it will not really update the ledger.
	GetUpdateWithFullBlock(block *wire.MsgBlock) (*state.Update, error)

	// GetUpdateWithSlimBlock is similar to GetUpdateWithFullBlock, but it updates with the slimblock rather than fullblock.
	GetUpdateWithSlimBlock(slimblock *wire.SlimBlock) (*state.Update, error)

	// It returns the available header according to the given ledgerInfo.
	GetBlockHeadersToAppend(ledgerInfo *wire.LedgerInfo) ([]*wire.BlockHeader, error)
}

LedgerStateManager is used to manage ledger statue.

Jump to

Keyboard shortcuts

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