Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockABCI ¶
func NewMockABCI(shardIndex shard.Index, startHeight int64, pubSubMgr *message.PubSubManager) iabci.AppBlockChain
NewMockABCI will return a fake abci, who will always return a particular blockBodyHash when ProposeBlock is called.
Types ¶
type BcProducer ¶
type BcProducer struct {
// contains filtered or unexported fields
}
BcProducer for easier testing.
func NewMockBcProducer ¶
func NewMockBcProducer(shard shard.Index) *BcProducer
NewMockBcProducer return BcProducer.
func (*BcProducer) GenerateBlockConfirmation ¶
func (mbcp *BcProducer) GenerateBlockConfirmation(message *wire.MsgBinaryBAFin) *wire.MsgBlockConfirmation
GenerateBlockConfirmation generate blockconfirmation message by bba final message.
func (*BcProducer) SaveHeader ¶
func (mbcp *BcProducer) SaveHeader(header *wire.BlockHeader)
SaveHeader cache block header.
type FakeTicker ¶
type FakeTicker struct { C chan time.Time Period time.Duration // contains filtered or unexported fields }
FakeTicker for easier testing.
func (*FakeTicker) Chan ¶
func (ft *FakeTicker) Chan() <-chan time.Time
Chan implement ticker interface
func (*FakeTicker) Tick ¶
func (ft *FakeTicker) Tick()
Tick sends the tick time to the ticker channel after every period. Tick events are discarded if the underlying ticker channel does not have enough capacity.
type HeartBeat ¶
type HeartBeat struct {
TestNodeNum int
}
HeartBeat for easier testing.
func (*HeartBeat) CheckConfirmation ¶
func (thbm *HeartBeat) CheckConfirmation(msg *wire.MsgBlockConfirmation) bool
CheckConfirmation implements HeatBeat interface.
func (*HeartBeat) PerceivedCount ¶
PerceivedCount implement HeartBeat interface
func (*HeartBeat) Receive ¶
func (thbm *HeartBeat) Receive(msg *wire.HeartBeatMsg)
Receive implement HeartBeat interface
type SyncMgr ¶
type SyncMgr struct{}
SyncMgr is a fake struct.
func (*SyncMgr) MaybeSync ¶
func (fsm *SyncMgr) MaybeSync()
MaybeSync is a fake method that does nothing.
func (*SyncMgr) OnNewPeer ¶
func (fsm *SyncMgr) OnNewPeer(cp *connection.ConnPeer, t config.NodeType)
OnNewPeer is a fake method that does nothing.
func (*SyncMgr) OnPeerDone ¶
func (fsm *SyncMgr) OnPeerDone(cp *connection.ConnPeer, t config.NodeType)
OnPeerDone is a fake method that does nothing.