Skip to content

Commit

Permalink
Fix typos in various files (#2407)
Browse files Browse the repository at this point in the history
## 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!

<!-- start pr-codex -->

---

## 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}`

<!-- end pr-codex -->
  • Loading branch information
crStiv authored Dec 7, 2024
1 parent 402cd54 commit 3ae1c71
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/hubble/src/network/p2p/connectionFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions apps/hubble/src/network/sync/merkleTrie.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions apps/hubble/src/network/sync/merkleTrie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class MerkleTrie {
return await rsMerkleTrieRootHash(this._rustTrie);
}

public async unloadChidrenAtRoot(): Promise<void> {
public async unloadChildrenAtRoot(): Promise<void> {
return await rsMerkleTrieUnloadChildren(this._rustTrie);
}

Expand All @@ -388,7 +388,7 @@ class MerkleTrie {
}

public async commitToDb(): Promise<void> {
return await this.unloadChidrenAtRoot();
return await this.unloadChildrenAtRoot();
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/hubble/src/network/sync/multiPeerSyncEngine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3ae1c71

Please sign in to comment.