From 3ae1c7187eb9c975e991653dff11bafa3a29a1ac Mon Sep 17 00:00:00 2001 From: crStiv Date: Sat, 7 Dec 2024 07:30:52 +0100 Subject: [PATCH] Fix typos in various files (#2407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why is this change needed? This pull request fixes multiple typos across several files in the repository to enhance code clarity and maintainability. Correcting these typos improves the readability of the code and prevents potential confusion for contributors and maintainers. ## Summary of Changes 1. **`apps/hubble/src/network/p2p/connectionFilter.ts`** - Fixed typo: `deiniedPeers` → `deniedPeers`. 2. **`apps/hubble/src/network/sync/merkleTrie.test.ts`** - Fixed typo: `unloadChidrenAtRoot` → `unloadChildrenAtRoot`. 3. **`apps/hubble/src/network/sync/merkleTrie.ts`** - Fixed typos: `unloadChidrenAtRoot` → `unloadChildrenAtRoot`. 4. **`apps/hubble/src/network/sync/multiPeerSyncEngine.test.ts`** - Fixed typo in comment: `cound` → `count`. ## Merge Checklist - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard. - [x] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets). - [x] PR has been tagged with a change label (e.g., documentation, bugfix). - [x] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. --- **Allow edits by maintainers:** ✅ Appreciate your time and review! --- ## PR-Codex overview This PR focuses on correcting typographical errors in method names and comments across multiple files, enhancing code clarity and maintainability. ### Detailed summary - Corrected method name from `unloadChidrenAtRoot` to `unloadChildrenAtRoot` in `merkleTrie.ts` and its test file. - Fixed parameter name from `deiniedPeers` to `deniedPeers` in the constructor of `connectionFilter.ts`. - Corrected the spelling of "count" in a comment in `multiPeerSyncEngine.test.ts`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- apps/hubble/src/network/p2p/connectionFilter.ts | 4 ++-- apps/hubble/src/network/sync/merkleTrie.test.ts | 6 +++--- apps/hubble/src/network/sync/merkleTrie.ts | 4 ++-- apps/hubble/src/network/sync/multiPeerSyncEngine.test.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/hubble/src/network/p2p/connectionFilter.ts b/apps/hubble/src/network/p2p/connectionFilter.ts index a0e487d0d9..2230b856a9 100644 --- a/apps/hubble/src/network/p2p/connectionFilter.ts +++ b/apps/hubble/src/network/p2p/connectionFilter.ts @@ -20,9 +20,9 @@ export class ConnectionFilter implements ConnectionGater { private allowedPeers: string[] | undefined; private deniedPeers: string[]; - constructor(addrs: string[] | undefined, deiniedPeers: string[] | undefined) { + constructor(addrs: string[] | undefined, deniedPeers: string[] | undefined) { this.allowedPeers = addrs; - this.deniedPeers = deiniedPeers ?? []; + this.deniedPeers = deniedPeers ?? []; } updateAllowedPeers(addrs: string[] | undefined) { diff --git a/apps/hubble/src/network/sync/merkleTrie.test.ts b/apps/hubble/src/network/sync/merkleTrie.test.ts index 04b2851be4..bc04f819f1 100644 --- a/apps/hubble/src/network/sync/merkleTrie.test.ts +++ b/apps/hubble/src/network/sync/merkleTrie.test.ts @@ -224,7 +224,7 @@ describe("MerkleTrie", () => { const rootHash = await trie.rootHash(); // Unload the trie - await trie.unloadChidrenAtRoot(); + await trie.unloadChildrenAtRoot(); // Expect the root hash to be the same expect(await trie.rootHash()).toEqual(rootHash); @@ -485,7 +485,7 @@ describe("MerkleTrie", () => { const rootHash = await trie.rootHash(); // Unload all the children of the first node - await trie.unloadChidrenAtRoot(); + await trie.unloadChildrenAtRoot(); // Now try deleting syncId1 expect(await trie.delete(syncId1)).toBeTruthy(); @@ -641,7 +641,7 @@ describe("MerkleTrie", () => { const trie = await trieWithIds([1665182332, 1665182343, 1665182345]); // Unload all the children of the first node - await trie.unloadChidrenAtRoot(); + await trie.unloadChildrenAtRoot(); let values = await trie.getAllValues(new Uint8Array(Buffer.from("16651823"))); expect(values?.length).toEqual(3); diff --git a/apps/hubble/src/network/sync/merkleTrie.ts b/apps/hubble/src/network/sync/merkleTrie.ts index f21f73f9bd..6fc60434dc 100644 --- a/apps/hubble/src/network/sync/merkleTrie.ts +++ b/apps/hubble/src/network/sync/merkleTrie.ts @@ -378,7 +378,7 @@ class MerkleTrie { return await rsMerkleTrieRootHash(this._rustTrie); } - public async unloadChidrenAtRoot(): Promise { + public async unloadChildrenAtRoot(): Promise { return await rsMerkleTrieUnloadChildren(this._rustTrie); } @@ -388,7 +388,7 @@ class MerkleTrie { } public async commitToDb(): Promise { - return await this.unloadChidrenAtRoot(); + return await this.unloadChildrenAtRoot(); } } diff --git a/apps/hubble/src/network/sync/multiPeerSyncEngine.test.ts b/apps/hubble/src/network/sync/multiPeerSyncEngine.test.ts index 36a398498b..e88c30ced3 100644 --- a/apps/hubble/src/network/sync/multiPeerSyncEngine.test.ts +++ b/apps/hubble/src/network/sync/multiPeerSyncEngine.test.ts @@ -778,7 +778,7 @@ describe("Multi peer sync engine with streams", () => { const messageStats2 = (await syncHealthProbe.computeSyncHealthMessageStats(start, stop))._unsafeUnwrap(); - // Query is inclusive of the start time and exclusive of the stop time. We cound 150, 170, 180 on engine1 and 150, 170 on engine 2 + // Query is inclusive of the start time and exclusive of the stop time. We count 150, 170, 180 on engine1 and 150, 170 on engine 2 expect(messageStats2.primaryNumMessages).toEqual(3); expect(messageStats2.peerNumMessages).toEqual(2);