mirror of
https://github.com/luxfi/p2p.git
synced 2026-10-30 15:22:55 +00:00
Update proto definitions to match latest p2p spec. Remove AllChains field from Handshake/GetPeerList messages. Update dependency versions.
45 lines
910 B
Go
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
|
|
}
|