Files
p2p/peer/test_network.go
zeekay 2306c15247 chore: update dependencies and fix proto compatibility
Update proto definitions to match latest p2p spec.
Remove AllChains field from Handshake/GetPeerList messages.
Update dependency versions.
2026-01-26 08:30:22 -08:00

45 lines
910 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
// 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/node/utils/bloom"
"github.com/luxfi/node/utils/ips"
)
var TestNetwork Network = testNetwork{}
type testNetwork struct{}
func (testNetwork) Connected(ids.NodeID) {}
func (testNetwork) AllowConnection(ids.NodeID) bool {
return true
}
func (testNetwork) Track([]*ips.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,
) []*ips.ClaimedIPPort {
return nil
}