testnetwork

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: AGPL-3.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 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, receiverFunc network.TxReceiver)

func (*MockNet) ProcessTransactions added in v0.3.0

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

func (*MockNet) PublishBlock added in v1.0.0

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 added in v1.0.0

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

func (m *MockNet) SetErrorState(err error)

func (*MockNet) SubscribeToBlocks added in v1.0.0

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

func (*MockNet) UnregisterValidatorProtocols added in v1.0.0

func (n *MockNet) UnregisterValidatorProtocols()

func (*MockNet) UnsubscribeFromBlocks added in v1.0.0

func (m *MockNet) UnsubscribeFromBlocks()

func (*MockNet) WaitReceive added in v1.0.0

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

func (*MockNet) WaitRootProposal added in v1.0.0

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