From 240428daf976acbe273663565a47b723aa7495f2 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 24 Apr 2025 00:39:59 +0800 Subject: [PATCH] Fix: Spelling errors in the code repository --- packages/crypto/src/bip39.ts | 4 ++-- packages/faucet/src/api/webserver.ts | 2 +- packages/faucet/src/pathbuilder.ts | 4 ++-- packages/math/src/integers.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/crypto/src/bip39.ts b/packages/crypto/src/bip39.ts index 73c194b7..7e3b9a46 100644 --- a/packages/crypto/src/bip39.ts +++ b/packages/crypto/src/bip39.ts @@ -2093,7 +2093,7 @@ export function entropyToMnemonic(entropy: Uint8Array): string { return words.join(" "); } -const invalidNumberOfWorks = "Invalid number of words"; +const invalidNumberOfWords = "Invalid number of words"; const wordNotInWordlist = "Found word that is not in the wordlist"; const invalidEntropy = "Invalid entropy"; const invalidChecksum = "Invalid mnemonic checksum"; @@ -2105,7 +2105,7 @@ function normalize(str: string): string { export function mnemonicToEntropy(mnemonic: string): Uint8Array { const words = normalize(mnemonic).split(" "); if (!allowedWordLengths.includes(words.length)) { - throw new Error(invalidNumberOfWorks); + throw new Error(invalidNumberOfWords); } // convert word indices to 11 bit binary strings diff --git a/packages/faucet/src/api/webserver.ts b/packages/faucet/src/api/webserver.ts index c17b0656..4906cb8d 100644 --- a/packages/faucet/src/api/webserver.ts +++ b/packages/faucet/src/api/webserver.ts @@ -71,7 +71,7 @@ export class Webserver { if (entry.getTime() + cooldownTimeMs > Date.now()) { throw new HttpError( 405, - `Too many request for the same address. Blocked to prevent draining. Please wait ${constants.cooldownTime} seconds and try it again!`, + `Too many requests for the same address. Blocked to prevent draining. Please wait ${constants.cooldownTime} seconds and try it again!`, ); } } diff --git a/packages/faucet/src/pathbuilder.ts b/packages/faucet/src/pathbuilder.ts index f108acaf..ad76e5b4 100644 --- a/packages/faucet/src/pathbuilder.ts +++ b/packages/faucet/src/pathbuilder.ts @@ -3,8 +3,8 @@ import { HdPath, stringToPath } from "@cosmjs/crypto"; export type PathBuilder = (account_index: number) => HdPath; /** - * Insert a BIP32 path that contains a valiable `a` for the numeric account index. - * This variable will be replaces when the path builder is used. + * Insert a BIP32 path that contains a variable `a` for the numeric account index. + * This variable will be replaced when the path builder is used. * * @param pattern, e.g. m/44'/148'/a' for Stellar paths */ diff --git a/packages/math/src/integers.ts b/packages/math/src/integers.ts index ee4a9dfe..746825bc 100644 --- a/packages/math/src/integers.ts +++ b/packages/math/src/integers.ts @@ -48,7 +48,7 @@ export class Uint32 implements Integer, WithByteConverters { const beBytes = endianess === "be" ? bytes : Array.from(bytes).reverse(); - // Use mulitiplication instead of shifting since bitwise operators are defined + // Use multiplication instead of shifting since bitwise operators are defined // on SIGNED int32 in JavaScript and we don't want to risk surprises return new Uint32(beBytes[0] * 2 ** 24 + beBytes[1] * 2 ** 16 + beBytes[2] * 2 ** 8 + beBytes[3]); }