chain_genesis

package
v2.11.3-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

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

func CheckSum

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

func InitLedger

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

func NewGenesisAccountBlocks

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

func NewGenesisSnapshotBlock

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

func UpdateDexFundOwner

func UpdateDexFundOwner(cfg *config.Genesis)

func VmBlocksToHashMap

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

Types

type Chain

type Chain interface {
	InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock) (invalidAccountBlocks []*ledger.AccountBlock, err error)
	InsertAccountBlock(vmAccountBlocks *interfaces.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 []*interfaces.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