Files
warp/fake_sender.go
zeekay a6a130382a refactor: simplify Sender and Handler interface method names
Remove Warp prefix from method names since package already provides context:
- SendWarpRequest -> SendRequest
- SendWarpResponse -> SendResponse
- SendWarpError -> SendError
- SendWarpGossip -> SendGossip
- WarpRequest -> Request
- WarpResponse -> Response
- WarpGossip -> Gossip
- WarpRequestFailed -> RequestFailed

Add interface compliance check for FakeSender.
2025-12-12 12:42:40 -08:00

34 lines
755 B
Go

// Copyright (C) 2019-2025, Lux Industries Inc All rights reserved.
// See the file LICENSE for licensing terms.
package warp
import (
"context"
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
)
// FakeSender is a test implementation of Sender that does nothing.
type FakeSender struct{}
// Interface compliance check
var _ Sender = FakeSender{}
func (FakeSender) SendRequest(context.Context, set.Set[ids.NodeID], uint32, []byte) error {
return nil
}
func (FakeSender) SendResponse(context.Context, ids.NodeID, uint32, []byte) error {
return nil
}
func (FakeSender) SendError(context.Context, ids.NodeID, uint32, int32, string) error {
return nil
}
func (FakeSender) SendGossip(context.Context, SendConfig, []byte) error {
return nil
}