testnetwork

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockNet

type MockNet struct {
	MessageCh chan any
	// contains filtered or unexported fields
}

func NewMockNetwork

func NewMockNetwork(t *testing.T) *MockNet

func NewRootMockNetwork

func NewRootMockNetwork() *MockNet

func (*MockNet) AddTransaction

func (m *MockNet) AddTransaction(ctx context.Context, tx *types.TransactionOrder) ([]byte, error)

func (*MockNet) ForwardTransactions

func (m *MockNet) ForwardTransactions(ctx context.Context, receiverFunc network.TxReceiver)

func (*MockNet) ProcessTransactions

func (m *MockNet) ProcessTransactions(ctx context.Context, txProcessor network.TxProcessor)

func (*MockNet) PublishBlock

func (m *MockNet) PublishBlock(ctx context.Context, block *types.Block) error

func (*MockNet) Receive

func (m *MockNet) Receive(msg any)

func (*MockNet) ReceivedChannel

func (m *MockNet) ReceivedChannel() <-chan any

func (*MockNet) RegisterValidatorProtocols

func (n *MockNet) RegisterValidatorProtocols() error

func (*MockNet) ResetSentMessages

func (m *MockNet) ResetSentMessages(protocol string)

func (*MockNet) Send

func (m *MockNet) Send(ctx context.Context, msg any, receivers ...peer.ID) error

func (*MockNet) SentMessages

func (m *MockNet) SentMessages(protocol string) []PeerMessage

func (*MockNet) SetErrorState

func (m *MockNet) SetErrorState(err error)

func (*MockNet) SubscribeToBlocks

func (m *MockNet) SubscribeToBlocks(ctx context.Context) error

func (*MockNet) UnregisterValidatorProtocols

func (n *MockNet) UnregisterValidatorProtocols()

func (*MockNet) UnsubscribeFromBlocks

func (m *MockNet) UnsubscribeFromBlocks()

func (*MockNet) WaitReceive

func (m *MockNet) WaitReceive(t *testing.T, msg any)

func (*MockNet) WaitRootProposal

func (m *MockNet) WaitRootProposal(t *testing.T) *abdrc.ProposalMsg

type PeerMessage

type PeerMessage struct {
	peer.ID
	Message any
}

Jump to

Keyboard shortcuts

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