Documentation ¶
Index ¶
- type ArbitratorsMock
- func (a *ArbitratorsMock) ForceChange() error
- func (a *ArbitratorsMock) GetArbitrators() [][]byte
- func (a *ArbitratorsMock) GetArbitratorsProgramHashes() []*common.Uint168
- func (a *ArbitratorsMock) GetCandidates() [][]byte
- func (a *ArbitratorsMock) GetCandidatesProgramHashes() []*common.Uint168
- func (a *ArbitratorsMock) GetDutyChangeCount() uint32
- func (a *ArbitratorsMock) GetDutyChangedCount() uint32
- func (a *ArbitratorsMock) GetNextArbitrators() [][]byte
- func (a *ArbitratorsMock) GetNextCandidates() [][]byte
- func (a *ArbitratorsMock) GetNextOnDutyArbitrator(offset uint32) []byte
- func (a *ArbitratorsMock) GetOnDutyArbitrator() []byte
- func (a *ArbitratorsMock) HasArbitersMajorityCount(num uint32) bool
- func (a *ArbitratorsMock) HasArbitersMinorityCount(num uint32) bool
- func (a *ArbitratorsMock) OnBlockReceived(b *types.Block, confirmed bool)
- func (a *ArbitratorsMock) OnConfirmReceived(p *types.DPosProposalVoteSlot)
- func (a *ArbitratorsMock) RegisterListener(listener interfaces.ArbitratorsListener)
- func (a *ArbitratorsMock) SetArbitrators(ar [][]byte)
- func (a *ArbitratorsMock) SetCandidates(ca [][]byte)
- func (a *ArbitratorsMock) SetDutyChangeCount(count uint32)
- func (a *ArbitratorsMock) SetDutyChangedCount(count uint32)
- func (a *ArbitratorsMock) SetNextArbitrators(ar [][]byte)
- func (a *ArbitratorsMock) SetNextCandidates(ca [][]byte)
- func (a *ArbitratorsMock) StartUp() error
- func (a *ArbitratorsMock) UnregisterListener(listener interfaces.ArbitratorsListener)
- type BlockHeightMock
- func (b *BlockHeightMock) AddBlock(block *types.Block) (bool, bool, error)
- func (b *BlockHeightMock) AddDposBlock(block *types.DposBlock) (bool, bool, error)
- func (b *BlockHeightMock) AssignCoinbaseTxRewards(block *types.Block, totalReward common.Fixed64) error
- func (b *BlockHeightMock) CheckCoinbaseArbitratorsReward(blockHeight uint32, coinbase *types.Transaction, ...) error
- func (b *BlockHeightMock) CheckCoinbaseMinerReward(blockHeight uint32, tx *types.Transaction, totalReward common.Fixed64) error
- func (b *BlockHeightMock) CheckConfirmedBlockOnFork(block *types.Block) error
- func (b *BlockHeightMock) CheckOutputPayload(blockHeight uint32, tx *types.Transaction, output *types.Output) error
- func (b *BlockHeightMock) CheckOutputProgramHash(blockHeight uint32, tx *types.Transaction, programHash common.Uint168) error
- func (b *BlockHeightMock) CheckTxHasNoPrograms(blockHeight uint32, tx *types.Transaction) error
- func (b *BlockHeightMock) CheckVoteProducerOutputs(blockHeight uint32, tx *types.Transaction, outputs []*types.Output, ...) error
- func (b *BlockHeightMock) GetDefaultBlockVersion(blockHeight uint32) uint32
- func (b *BlockHeightMock) GetDefaultTxVersion(blockHeight uint32) byte
- func (b *BlockHeightMock) GetNextOnDutyArbitrator(blockHeight, dutyChangedCount, offset uint32) []byte
- func (b *BlockHeightMock) GetProducersDesc(block *types.Block) ([][]byte, error)
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) AddDposBlock ¶
func (*BlockHeightMock) AssignCoinbaseTxRewards ¶
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 (*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)
Click to show internal directories.
Click to hide internal directories.