mock

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: 3 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

This section is empty.

Types

type ArbitratorsMock

type ArbitratorsMock struct {
	CurrentArbitrators         [][]byte
	CurrentCandidates          [][]byte
	NextArbitrators            [][]byte
	NextCandidates             [][]byte
	CurrentArbitratorsPrograms []*common.Uint168
	CurrentCandidatesPrograms  []*common.Uint168
	DutyChangedCount           uint32
	MajorityCount              uint32
}

mock object of arbitrators

func NewArbitratorsMock

func NewArbitratorsMock(arbitersByte [][]byte, changeCount, majorityCount uint32) *ArbitratorsMock

func (*ArbitratorsMock) ForceChange

func (a *ArbitratorsMock) ForceChange() error

func (*ArbitratorsMock) GetArbitrators

func (a *ArbitratorsMock) GetArbitrators() [][]byte

func (*ArbitratorsMock) GetArbitratorsProgramHashes

func (a *ArbitratorsMock) GetArbitratorsProgramHashes() []*common.Uint168

func (*ArbitratorsMock) GetCandidates

func (a *ArbitratorsMock) GetCandidates() [][]byte

func (*ArbitratorsMock) GetCandidatesProgramHashes

func (a *ArbitratorsMock) GetCandidatesProgramHashes() []*common.Uint168

func (*ArbitratorsMock) GetDutyChangeCount

func (a *ArbitratorsMock) GetDutyChangeCount() uint32

func (*ArbitratorsMock) GetDutyChangedCount

func (a *ArbitratorsMock) GetDutyChangedCount() uint32

func (*ArbitratorsMock) GetNextArbitrators

func (a *ArbitratorsMock) GetNextArbitrators() [][]byte

func (*ArbitratorsMock) GetNextCandidates

func (a *ArbitratorsMock) GetNextCandidates() [][]byte

func (*ArbitratorsMock) GetNextOnDutyArbitrator

func (a *ArbitratorsMock) GetNextOnDutyArbitrator(offset uint32) []byte

func (*ArbitratorsMock) GetOnDutyArbitrator

func (a *ArbitratorsMock) GetOnDutyArbitrator() []byte

func (*ArbitratorsMock) HasArbitersMajorityCount

func (a *ArbitratorsMock) HasArbitersMajorityCount(num uint32) bool

func (*ArbitratorsMock) HasArbitersMinorityCount

func (a *ArbitratorsMock) HasArbitersMinorityCount(num uint32) bool

func (*ArbitratorsMock) OnBlockReceived

func (a *ArbitratorsMock) OnBlockReceived(b *types.Block, confirmed bool)

func (*ArbitratorsMock) OnConfirmReceived

func (a *ArbitratorsMock) OnConfirmReceived(p *types.DPosProposalVoteSlot)

func (*ArbitratorsMock) RegisterListener

func (a *ArbitratorsMock) RegisterListener(listener interfaces.ArbitratorsListener)

func (*ArbitratorsMock) SetArbitrators

func (a *ArbitratorsMock) SetArbitrators(ar [][]byte)

func (*ArbitratorsMock) SetCandidates

func (a *ArbitratorsMock) SetCandidates(ca [][]byte)

func (*ArbitratorsMock) SetDutyChangeCount

func (a *ArbitratorsMock) SetDutyChangeCount(count uint32)

func (*ArbitratorsMock) SetDutyChangedCount

func (a *ArbitratorsMock) SetDutyChangedCount(count uint32)

func (*ArbitratorsMock) SetNextArbitrators

func (a *ArbitratorsMock) SetNextArbitrators(ar [][]byte)

func (*ArbitratorsMock) SetNextCandidates

func (a *ArbitratorsMock) SetNextCandidates(ca [][]byte)

func (*ArbitratorsMock) StartUp

func (a *ArbitratorsMock) StartUp() error

func (*ArbitratorsMock) UnregisterListener

func (a *ArbitratorsMock) UnregisterListener(listener interfaces.ArbitratorsListener)

type BlockHeightMock

type BlockHeightMock struct {
	Producers           [][]byte
	ShouldConfirm       bool
	CurrentArbitrator   []byte
	DefaultTxVersion    byte
	DefaultBlockVersion uint32
}

func NewBlockHeightMock

func NewBlockHeightMock() *BlockHeightMock

func (*BlockHeightMock) AddBlock

func (b *BlockHeightMock) AddBlock(block *types.Block) (bool, bool, error)

func (*BlockHeightMock) AddDposBlock

func (b *BlockHeightMock) AddDposBlock(block *types.DposBlock) (bool, bool, error)

func (*BlockHeightMock) AssignCoinbaseTxRewards

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

func (*BlockHeightMock) CheckCoinbaseArbitratorsReward

func (b *BlockHeightMock) CheckCoinbaseArbitratorsReward(blockHeight uint32, coinbase *types.Transaction, rewardInCoinbase common.Fixed64) error

func (*BlockHeightMock) CheckCoinbaseMinerReward

func (b *BlockHeightMock) CheckCoinbaseMinerReward(blockHeight uint32, tx *types.Transaction, totalReward common.Fixed64) error

func (*BlockHeightMock) CheckConfirmedBlockOnFork

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

func (*BlockHeightMock) CheckOutputPayload

func (b *BlockHeightMock) CheckOutputPayload(blockHeight uint32, tx *types.Transaction, output *types.Output) error

func (*BlockHeightMock) CheckOutputProgramHash

func (b *BlockHeightMock) CheckOutputProgramHash(blockHeight uint32, tx *types.Transaction, programHash common.Uint168) error

func (*BlockHeightMock) CheckTxHasNoPrograms

func (b *BlockHeightMock) CheckTxHasNoPrograms(blockHeight uint32, tx *types.Transaction) error

func (*BlockHeightMock) CheckVoteProducerOutputs

func (b *BlockHeightMock) CheckVoteProducerOutputs(blockHeight uint32, tx *types.Transaction, outputs []*types.Output,
	references map[*types.Input]*types.Output, producers [][]byte) error

func (*BlockHeightMock) GetDefaultBlockVersion

func (b *BlockHeightMock) GetDefaultBlockVersion(blockHeight uint32) uint32

func (*BlockHeightMock) GetDefaultTxVersion

func (b *BlockHeightMock) GetDefaultTxVersion(blockHeight uint32) byte

func (*BlockHeightMock) GetNextOnDutyArbitrator

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

func (*BlockHeightMock) GetProducersDesc

func (b *BlockHeightMock) GetProducersDesc(block *types.Block) ([][]byte, error)

Jump to

Keyboard shortcuts

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