version

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHeightVersions

func NewHeightVersions(versions map[uint32]VersionInfo) interfaces.HeightVersions

Types

type BlockCheckMethod

type BlockCheckMethod func(BlockVersion) (bool, bool, error)

type BlockConfirmCheckMethod

type BlockConfirmCheckMethod func(BlockVersion) (bool, bool, error)

type BlockVersion

type BlockVersion interface {
	GetVersion() uint32
	GetProducersDesc() ([][]byte, error)
	AddDposBlock(block *types.DposBlock) (bool, bool, error)
	AssignCoinbaseTxRewards(block *types.Block, totalReward common.Fixed64) error
	CheckConfirmedBlockOnFork(block *types.Block) error
	GetNextOnDutyArbitrator(dutyChangedCount, offset uint32) []byte
}

type BlockVersionMain

type BlockVersionMain struct {
}

func (*BlockVersionMain) AddDposBlock

func (b *BlockVersionMain) AddDposBlock(dposBlock *types.DposBlock) (bool, bool, error)

func (*BlockVersionMain) AssignCoinbaseTxRewards

func (b *BlockVersionMain) AssignCoinbaseTxRewards(block *types.Block, totalReward common.Fixed64) error

func (*BlockVersionMain) CheckConfirmedBlockOnFork

func (b *BlockVersionMain) CheckConfirmedBlockOnFork(block *types.Block) error

func (*BlockVersionMain) GetNextOnDutyArbitrator

func (b *BlockVersionMain) GetNextOnDutyArbitrator(dutyChangedCount, offset uint32) []byte

func (*BlockVersionMain) GetProducersDesc

func (b *BlockVersionMain) GetProducersDesc() ([][]byte, error)

func (*BlockVersionMain) GetVersion

func (b *BlockVersionMain) GetVersion() uint32

type TxCheckMethod

type TxCheckMethod func(TxVersion) error

type TxVersion

type TxVersion interface {
	GetVersion() byte

	CheckOutputPayload(txType types.TransactionType, output *types.Output) error
	CheckOutputProgramHash(programHash common.Uint168) error
	CheckCoinbaseMinerReward(tx *types.Transaction, totalReward common.Fixed64) error
	CheckCoinbaseArbitratorsReward(coinbase *types.Transaction, rewardInCoinbase common.Fixed64) error
	CheckVoteProducerOutputs(outputs []*types.Output, references map[*types.Input]*types.Output, producers [][]byte) error
	CheckTxHasNoPrograms(tx *types.Transaction) error
}

type TxVersionMain

type TxVersionMain struct {
}

func (*TxVersionMain) CheckCoinbaseArbitratorsReward

func (v *TxVersionMain) CheckCoinbaseArbitratorsReward(coinbase *types.Transaction, rewardInCoinbase common.Fixed64) error

func (*TxVersionMain) CheckCoinbaseMinerReward

func (v *TxVersionMain) CheckCoinbaseMinerReward(tx *types.Transaction, totalReward common.Fixed64) error

func (*TxVersionMain) CheckOutputPayload

func (v *TxVersionMain) CheckOutputPayload(txType types.TransactionType, output *types.Output) error

func (*TxVersionMain) CheckOutputProgramHash

func (v *TxVersionMain) CheckOutputProgramHash(programHash common.Uint168) error

func (*TxVersionMain) CheckTxHasNoPrograms

func (v *TxVersionMain) CheckTxHasNoPrograms(tx *types.Transaction) error

func (*TxVersionMain) CheckVoteProducerOutputs

func (v *TxVersionMain) CheckVoteProducerOutputs(outputs []*types.Output, references map[*types.Input]*types.Output, producers [][]byte) error

func (*TxVersionMain) GetVersion

func (v *TxVersionMain) GetVersion() byte

type VersionInfo

type VersionInfo struct {
	DefaultTxVersion        byte
	DefaultBlockVersion     uint32
	CompatibleTxVersions    map[byte]TxVersion
	CompatibleBlockVersions map[uint32]BlockVersion
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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