testnetwork

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: AGPL-3.0 Imports: 19 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 added in v0.3.0

func NewRootMockNetwork() *MockNet

func (*MockNet) AddTransaction added in v0.3.0

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

func (*MockNet) ForwardTransactions added in v0.3.0

func (m *MockNet) ForwardTransactions(ctx context.Context, receiver peer.ID)

func (*MockNet) ProcessTransactions added in v0.3.0

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

func (*MockNet) Receive

func (m *MockNet) Receive(msg any)

func (*MockNet) ReceivedChannel

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

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 added in v0.2.0

func (m *MockNet) SetErrorState(err error)

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