mirror of
https://github.com/libp2p/go-libp2p.git
synced 2025-10-14 12:23:58 +08:00
chore: fix typos (#2689)
This commit is contained in:
@@ -25,7 +25,7 @@ func TestECDSABasicSignAndVerify(t *testing.T) {
|
||||
}
|
||||
|
||||
if !ok {
|
||||
t.Fatal("signature didnt match")
|
||||
t.Fatal("signature didn't match")
|
||||
}
|
||||
|
||||
// change data
|
||||
|
@@ -24,7 +24,7 @@ func TestRSABasicSignAndVerify(t *testing.T) {
|
||||
}
|
||||
|
||||
if !ok {
|
||||
t.Fatal("signature didnt match")
|
||||
t.Fatal("signature didn't match")
|
||||
}
|
||||
|
||||
// change data
|
||||
|
@@ -24,7 +24,7 @@ func TestSecp256k1BasicSignAndVerify(t *testing.T) {
|
||||
}
|
||||
|
||||
if !ok {
|
||||
t.Fatal("signature didnt match")
|
||||
t.Fatal("signature didn't match")
|
||||
}
|
||||
|
||||
// change data
|
||||
|
@@ -76,7 +76,7 @@ type Routing interface {
|
||||
ValueStore
|
||||
|
||||
// Bootstrap allows callers to hint to the routing system to get into a
|
||||
// Boostrapped state and remain there. It is not a synchronous call.
|
||||
// Bootstrapped state and remain there. It is not a synchronous call.
|
||||
Bootstrap(context.Context) error
|
||||
|
||||
// TODO expose io.Closer or plain-old Close error
|
||||
|
@@ -110,7 +110,7 @@ func (m *MessageData) GetSign() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
// a protocol define a set of reuqest and responses
|
||||
// A protocol defines a set of requests and responses.
|
||||
type PingRequest struct {
|
||||
MessageData *MessageData `protobuf:"bytes,1,opt,name=messageData" json:"messageData,omitempty"`
|
||||
// method specific data
|
||||
@@ -205,7 +205,7 @@ func (m *PingResponse) GetMessage() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// a protocol define a set of reuqest and responses
|
||||
// A protocol defines a set of requests and responses
|
||||
type EchoRequest struct {
|
||||
MessageData *MessageData `protobuf:"bytes,1,opt,name=messageData" json:"messageData,omitempty"`
|
||||
// method specific data
|
||||
|
@@ -16,7 +16,7 @@ message MessageData {
|
||||
|
||||
//// ping protocol
|
||||
|
||||
// a protocol define a set of reuqest and responses
|
||||
// A protocol defines a set of requests and responses.
|
||||
message PingRequest {
|
||||
MessageData messageData = 1;
|
||||
|
||||
@@ -36,7 +36,7 @@ message PingResponse {
|
||||
|
||||
//// echo protocol
|
||||
|
||||
// a protocol define a set of reuqest and responses
|
||||
// A protocol defines a set of requests and responses.
|
||||
message EchoRequest {
|
||||
MessageData messageData = 1;
|
||||
|
||||
|
@@ -189,7 +189,7 @@ func TestAutoNATServiceRateLimitJitter(t *testing.T) {
|
||||
svc.mx.Lock()
|
||||
defer svc.mx.Unlock()
|
||||
return svc.globalReqs == 0
|
||||
}, dur*5/2, 10*time.Millisecond, "reset of rate limitter occurred slower than expected")
|
||||
}, dur*5/2, 10*time.Millisecond, "reset of rate limiter occurred slower than expected")
|
||||
}
|
||||
|
||||
func TestAutoNATServiceStartup(t *testing.T) {
|
||||
|
@@ -59,7 +59,7 @@ var (
|
||||
prometheus.CounterOpts{
|
||||
Namespace: metricNamespace,
|
||||
Name: "candidates_circuit_v2_support_total",
|
||||
Help: "Candidiates supporting circuit v2",
|
||||
Help: "Candidates supporting circuit v2",
|
||||
},
|
||||
[]string{"support"},
|
||||
)
|
||||
@@ -167,7 +167,7 @@ func NewMetricsTracer(opts ...MetricsTracerOption) MetricsTracer {
|
||||
metricshelper.RegisterCollectors(setting.reg, collectors...)
|
||||
|
||||
// Initialise these counters to 0 otherwise the first reservation requests aren't handled
|
||||
// correctly when using promql increse function
|
||||
// correctly when using promql increase function
|
||||
reservationRequestsOutcomeTotal.WithLabelValues("refresh", "success")
|
||||
reservationRequestsOutcomeTotal.WithLabelValues("new", "success")
|
||||
candidatesCircuitV2SupportTotal.WithLabelValues("yes")
|
||||
|
@@ -63,7 +63,7 @@ type relayFinder struct {
|
||||
candidates map[peer.ID]*candidate
|
||||
backoff map[peer.ID]time.Time
|
||||
maybeConnectToRelayTrigger chan struct{} // cap: 1
|
||||
// Any time _something_ hapens that might cause us to need new candidates.
|
||||
// Any time _something_ happens that might cause us to need new candidates.
|
||||
// This could be
|
||||
// * the disconnection of a relay
|
||||
// * the failed attempt to obtain a reservation with a current candidate
|
||||
|
@@ -127,7 +127,7 @@ func (nmgr *natManager) background(ctx context.Context) {
|
||||
for {
|
||||
select {
|
||||
case <-nmgr.syncFlag:
|
||||
nmgr.doSync() // sync when our listen addresses chnage.
|
||||
nmgr.doSync() // sync when our listen addresses change.
|
||||
case <-ctx.Done():
|
||||
return
|
||||
}
|
||||
|
@@ -113,7 +113,7 @@ func (t *Transport) SecureOutbound(ctx context.Context, insecure net.Conn, p pee
|
||||
for _, muxer := range t.muxers {
|
||||
muxers = append(muxers, (string)(muxer))
|
||||
}
|
||||
// Prepend the prefered muxers list to TLS config.
|
||||
// Prepend the preferred muxers list to TLS config.
|
||||
config.NextProtos = append(muxers, config.NextProtos...)
|
||||
cs, err := t.handshake(ctx, tls.Client(insecure, config), keyCh)
|
||||
if err != nil {
|
||||
|
@@ -79,7 +79,7 @@ func benchmarkHandshakes(b *testing.B, factory Factory) {
|
||||
|
||||
pipes := make(chan net.Conn, 1)
|
||||
|
||||
var finished sync.Mutex // wait until all data has been transfered
|
||||
var finished sync.Mutex // wait until all data has been transferred
|
||||
finished.Lock()
|
||||
go func() {
|
||||
defer finished.Unlock()
|
||||
|
Reference in New Issue
Block a user