chain_genesis

package
v2.3.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LedgerUnknown = byte(0)
	LedgerEmpty   = byte(1)
	LedgerValid   = byte(2)
	LedgerInvalid = byte(3)
)

Variables

This section is empty.

Functions

func CheckLedger

func CheckLedger(chain Chain, genesisSnapshotBlock *ledger.SnapshotBlock) (byte, error)

func InitLedger

func InitLedger(chain Chain, genesisSnapshotBlock *ledger.SnapshotBlock, vmBlocks []*vm_db.VmAccountBlock) error

func NewGenesisAccountBlocks

func NewGenesisAccountBlocks(cfg *config.Genesis) []*vm_db.VmAccountBlock

func NewGenesisSnapshotBlock

func NewGenesisSnapshotBlock(accountBlocks []*vm_db.VmAccountBlock) *ledger.SnapshotBlock

func VmBlocksToHashMap

func VmBlocksToHashMap(accountBlocks []*vm_db.VmAccountBlock) map[types.Hash]struct{}

Types

type Chain

type Chain interface {
	InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock) (invalidAccountBlocks []*ledger.AccountBlock, err error)
	InsertAccountBlock(vmAccountBlocks *vm_db.VmAccountBlock) error
	QuerySnapshotBlockByHeight(uint64) (*ledger.SnapshotBlock, error)
	GetContentNeedSnapshot() ledger.SnapshotContent
}

Jump to

Keyboard shortcuts

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