package test

import "github.com/libp2p/go-libp2p/p2p/host/peerstore/test"

Index

Functions

func AssertAddressesEqual

func AssertAddressesEqual(t *testing.T, exp, act []ma.Multiaddr)

func BenchmarkKeyBook

func BenchmarkKeyBook(b *testing.B, factory KeyBookFactory)

func BenchmarkPeerstore

func BenchmarkPeerstore(b *testing.B, factory PeerstoreFactory, variant string)

func GenerateAddrs

func GenerateAddrs(count int) []ma.Multiaddr

func GeneratePeerIDs

func GeneratePeerIDs(count int) []peer.ID

func Multiaddr

func Multiaddr(m string) ma.Multiaddr

func RandomPeer

func RandomPeer(b *testing.B, addrCount int) *peerpair

func TestAddrBook

func TestAddrBook(t *testing.T, factory AddrBookFactory, clk *mockClock.Mock)

func TestKeyBook

func TestKeyBook(t *testing.T, factory KeyBookFactory)

func TestPeerstore

func TestPeerstore(t *testing.T, factory PeerstoreFactory)

func TestPeerstoreProtoStoreLimits

func TestPeerstoreProtoStoreLimits(t *testing.T, ps pstore.Peerstore, limit int)

Types

type AddrBookFactory

type AddrBookFactory func() (pstore.AddrBook, func())

type KeyBookFactory

type KeyBookFactory func() (pstore.KeyBook, func())

type PeerstoreFactory

type PeerstoreFactory func() (pstore.Peerstore, func())

Source Files

addr_book_suite.go benchmarks_suite.go keybook_suite.go peerstore_suite.go utils.go

Version
v0.41.1 (latest)
Published
Mar 24, 2025
Platform
linux/amd64
Imports
16 packages
Last checked
3 weeks ago

Tools for package owners.