chain_genesis

package
v2.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: GPL-3.0 Imports: 12 Imported by: 1

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, genesisAccountBlocks []*vm_db.VmAccountBlock) (byte, error)

func CheckSum

func CheckSum(accountBlocks []*vm_db.VmAccountBlock) types.Hash

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

	WriteGenesisCheckSum(hash types.Hash) error
	QueryGenesisCheckSum() (*types.Hash, error)
}

type SortBalances

type SortBalances []struct {
	// contains filtered or unexported fields
}

func (SortBalances) Len

func (a SortBalances) Len() int

func (SortBalances) Less

func (a SortBalances) Less(i, j int) bool

func (SortBalances) Swap

func (a SortBalances) Swap(i, j int)

type SortVmBlocks

type SortVmBlocks []*vm_db.VmAccountBlock

func (SortVmBlocks) Len

func (a SortVmBlocks) Len() int

func (SortVmBlocks) Less

func (a SortVmBlocks) Less(i, j int) bool

func (SortVmBlocks) Swap

func (a SortVmBlocks) Swap(i, j int)

Jump to

Keyboard shortcuts

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