Files
node/mesh/peer/test_network.go
zeekayandHanzo Dev b1cc108c9f gofmt
Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 01:51:51 -07:00

42 lines
805 B
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package peer
import (
"github.com/luxfi/ids"
"github.com/luxfi/math/set"
"github.com/luxfi/net/endpoints"
"github.com/luxfi/node/utils/bloom"
)
var TestNetwork Network = testNetwork{}
type testNetwork struct{}
func (testNetwork) Connected(ids.NodeID) {}
func (testNetwork) AllowConnection(ids.NodeID) bool {
return true
}
func (testNetwork) Track([]*endpoints.ClaimedIPPort) error {
return nil
}
func (testNetwork) Disconnected(ids.NodeID) {}
func (testNetwork) KnownPeers() ([]byte, []byte) {
return bloom.EmptyFilter.Marshal(), nil
}
func (testNetwork) Peers(
ids.NodeID,
set.Set[ids.ID],
bool,
*bloom.ReadFilter,
[]byte,
) []*endpoints.ClaimedIPPort {
return nil
}