From 94d66e08110a7ac794cb849c786bf1945bfc3410 Mon Sep 17 00:00:00 2001 From: xiaolou86 Date: Wed, 11 Oct 2023 13:48:39 +0800 Subject: [PATCH] Fix typos --- .../blockpresencemanager/blockpresencemanager_test.go | 2 +- bitswap/client/internal/getter/getter.go | 2 +- .../providerquerymanager/providerquerymanager_test.go | 2 +- bitswap/metrics/metrics.go | 4 ++-- bitswap/server/internal/decision/engine_test.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bitswap/client/internal/blockpresencemanager/blockpresencemanager_test.go b/bitswap/client/internal/blockpresencemanager/blockpresencemanager_test.go index b0616e4e3..b977c28ff 100644 --- a/bitswap/client/internal/blockpresencemanager/blockpresencemanager_test.go +++ b/bitswap/client/internal/blockpresencemanager/blockpresencemanager_test.go @@ -218,7 +218,7 @@ func TestAllPeersDoNotHaveBlock(t *testing.T) { {[]peer.ID{p1}, []cid.Cid{c2}, []cid.Cid{}}, {[]peer.ID{p2}, []cid.Cid{c2}, []cid.Cid{c2}}, - // p0 recieved DONT_HAVE for c1 & c2 (but not for c0) + // p0 received DONT_HAVE for c1 & c2 (but not for c0) {[]peer.ID{p0}, []cid.Cid{c0, c1, c2}, []cid.Cid{c1, c2}}, {[]peer.ID{p0, p1}, []cid.Cid{c0, c1, c2}, []cid.Cid{}}, // Both p0 and p2 received DONT_HAVE for c2 diff --git a/bitswap/client/internal/getter/getter.go b/bitswap/client/internal/getter/getter.go index 713394b08..822d319b7 100644 --- a/bitswap/client/internal/getter/getter.go +++ b/bitswap/client/internal/getter/getter.go @@ -21,7 +21,7 @@ type GetBlocksFunc func(context.Context, []cid.Cid) (<-chan blocks.Block, error) // SyncGetBlock takes a block cid and an async function for getting several // blocks that returns a channel, and uses that function to return the -// block syncronously. +// block synchronously. func SyncGetBlock(p context.Context, k cid.Cid, gb GetBlocksFunc) (blocks.Block, error) { p, span := internal.StartSpan(p, "Getter.SyncGetBlock") defer span.End() diff --git a/bitswap/client/internal/providerquerymanager/providerquerymanager_test.go b/bitswap/client/internal/providerquerymanager/providerquerymanager_test.go index afdd19595..52447e2c1 100644 --- a/bitswap/client/internal/providerquerymanager/providerquerymanager_test.go +++ b/bitswap/client/internal/providerquerymanager/providerquerymanager_test.go @@ -281,7 +281,7 @@ func TestRateLimitingRequests(t *testing.T) { defer fpn.queriesMadeMutex.Unlock() if fpn.queriesMade != maxInProcessRequests+1 { t.Logf("Queries made: %d\n", fpn.queriesMade) - t.Fatal("Did not make all seperate requests") + t.Fatal("Did not make all separate requests") } } diff --git a/bitswap/metrics/metrics.go b/bitswap/metrics/metrics.go index b71923727..e40276842 100644 --- a/bitswap/metrics/metrics.go +++ b/bitswap/metrics/metrics.go @@ -14,11 +14,11 @@ var ( ) func DupHist(ctx context.Context) metrics.Histogram { - return metrics.NewCtx(ctx, "recv_dup_blocks_bytes", "Summary of duplicate data blocks recived").Histogram(metricsBuckets) + return metrics.NewCtx(ctx, "recv_dup_blocks_bytes", "Summary of duplicate data blocks received").Histogram(metricsBuckets) } func AllHist(ctx context.Context) metrics.Histogram { - return metrics.NewCtx(ctx, "recv_all_blocks_bytes", "Summary of all data blocks recived").Histogram(metricsBuckets) + return metrics.NewCtx(ctx, "recv_all_blocks_bytes", "Summary of all data blocks received").Histogram(metricsBuckets) } func SentHist(ctx context.Context) metrics.Histogram { diff --git a/bitswap/server/internal/decision/engine_test.go b/bitswap/server/internal/decision/engine_test.go index efc4408ff..b7382f817 100644 --- a/bitswap/server/internal/decision/engine_test.go +++ b/bitswap/server/internal/decision/engine_test.go @@ -138,7 +138,7 @@ func TestConsistentAccounting(t *testing.T) { t.Fatal("Inconsistent book-keeping. Strategies don't agree") } - // Ensure sender didn't record receving anything. And that the receiver + // Ensure sender didn't record receiving anything. And that the receiver // didn't record sending anything if receiver.Engine.numBytesSentTo(sender.Peer) != 0 || sender.Engine.numBytesReceivedFrom(receiver.Peer) != 0 { t.Fatal("Bert didn't send bytes to Ernie")