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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkMock

type NetworkMock interface {
	DposNetwork
	SetListener(listener NetworkEventListener)

	FirePing(id peer.PID, height uint32)
	FirePong(id peer.PID, height uint32)
	FireBlock(id peer.PID, block *types.Block)
	FireInv(id peer.PID, blockHash common.Uint256)
	FireGetBlock(id peer.PID, blockHash common.Uint256)
	FireGetBlocks(id peer.PID, startBlockHeight, endBlockHeight uint32)
	FireResponseBlocks(id peer.PID, blockConfirms []*types.DposBlock)
	FireRequestConsensus(id peer.PID, height uint32)
	FireResponseConsensus(id peer.PID, status *msg.ConsensusStatus)
	FireRequestProposal(id peer.PID, hash common.Uint256)
	FireIllegalProposalReceived(id peer.PID, proposals *types.DposIllegalProposals)
	FireIllegalVotesReceived(id peer.PID, votes *types.DposIllegalVotes)
	FireProposalReceived(id peer.PID, p types.DPosProposal)
	FireVoteReceived(id peer.PID, p types.DPosProposalVote)
	FireVoteRejected(id peer.PID, p types.DPosProposalVote)
	FireChangeView()
	FireBadNetwork()
	FireBlockReceived(b *types.Block, confirmed bool)
	FireConfirmReceived(p *types.DPosProposalVoteSlot)
	FireIllegalBlocksReceived(i *types.DposIllegalBlocks)

	GetLastMessage() p2p.Message
	GetLastPID() *peer.PID
	DumpMessages(level uint32) string
}

func NewNetworkMock

func NewNetworkMock() NetworkMock

type NodeMock

type NodeMock interface {
	protocol.Noder

	GetTxPool() *mempool.TxPool
	GetBlockPool() *mempool.BlockPool

	GetLastRelay() interface{}
	DumpRelays(level uint32) string
}

func NewNodeMock

func NewNodeMock() NodeMock

Jump to

Keyboard shortcuts

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