coremock

package
v1.22.45 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package coremock provides mock implementations for testing

Index

Constants

This section is empty.

Variables

View Source
var NewMockAppSender = NewMockWarpSender

Deprecated: Use NewMockWarpSender instead

Functions

This section is empty.

Types

type MockAppSender deprecated

type MockAppSender = MockWarpSender

Deprecated: Use MockWarpSender instead

type MockWarpSender added in v1.22.8

type MockWarpSender struct {
	SendRequestF  func(context.Context, set.Set[ids.NodeID], uint32, []byte) error
	SendResponseF func(context.Context, ids.NodeID, uint32, []byte) error
	SendErrorF    func(context.Context, ids.NodeID, uint32, int32, string) error
	SendGossipF   func(context.Context, p2p.SendConfig, []byte) error
	// contains filtered or unexported fields
}

MockWarpSender is a mock implementation of p2p.Sender (warp.Sender)

func NewMockWarpSender added in v1.22.8

func NewMockWarpSender(ctrl interface{}) *MockWarpSender

NewMockWarpSender creates a new mock WarpSender

func (*MockWarpSender) EXPECT added in v1.22.8

EXPECT returns mock expectation handler

func (*MockWarpSender) SendError added in v1.22.8

func (m *MockWarpSender) SendError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, errorMessage string) error

SendError implements p2p.Sender

func (*MockWarpSender) SendGossip added in v1.22.8

func (m *MockWarpSender) SendGossip(ctx context.Context, config p2p.SendConfig, gossipBytes []byte) error

SendGossip implements p2p.Sender

func (*MockWarpSender) SendRequest added in v1.22.8

func (m *MockWarpSender) SendRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, requestBytes []byte) error

SendRequest implements p2p.Sender

func (*MockWarpSender) SendResponse added in v1.22.8

func (m *MockWarpSender) SendResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, responseBytes []byte) error

SendResponse implements p2p.Sender

type MockWarpSenderCall added in v1.22.8

type MockWarpSenderCall struct {
	// contains filtered or unexported fields
}

MockWarpSenderCall represents a mock call

func (*MockWarpSenderCall) Return added in v1.22.8

Return sets the return value

func (*MockWarpSenderCall) Times added in v1.22.8

Times sets the number of times the call is expected

type MockWarpSenderExpects added in v1.22.8

type MockWarpSenderExpects struct {
	// contains filtered or unexported fields
}

MockWarpSenderExpects handles expectations

func (*MockWarpSenderExpects) SendRequest added in v1.22.8

func (e *MockWarpSenderExpects) SendRequest() *MockWarpSenderCall

SendRequest sets expectation for SendRequest

Jump to

Keyboard shortcuts

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