istate

package
Version: v0.0.0-...-dc87987 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL