mock

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: MIT Imports: 14 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 *payload.DPOSIllegalProposals)
	FireIllegalVotesReceived(id peer.PID, votes *payload.DPOSIllegalVotes)
	FireProposalReceived(id peer.PID, p *payload.DPOSProposal)
	FireVoteReceived(id peer.PID, p *payload.DPOSProposalVote)
	FireVoteRejected(id peer.PID, p *payload.DPOSProposalVote)
	FireChangeView()
	FireBadNetwork()
	FireBlockReceived(b *types.Block, confirmed bool)
	FireConfirmReceived(p *payload.Confirm)
	FireIllegalBlocksReceived(i *payload.DPOSIllegalBlocks)

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

func NewNetworkMock

func NewNetworkMock() NetworkMock

type PeerMock

type PeerMock interface {
	GetTxPool() *mempool.TxPool
	GetBlockPool() *mempool.BlockPool

	GetLastRelay() interface{}
	DumpRelays(level uint32) string
	Broadcast(msg p2p.Message)
}

func NewPeerMock

func NewPeerMock(params *config.Params) PeerMock

Jump to

Keyboard shortcuts

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