Skip to content

Commit 409afcb

Browse files
committed
chore: change method name
1 parent 49a7c6c commit 409afcb

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

packages/keyring-eth-hd/src/hd-keyring.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ export class HdKeyring implements Keyring {
611611
// Convert and validate before assigning to instance property
612612
// to avoid inconsistent state if validation fails
613613
const mnemonicAsUint8Array = this.#mnemonicToUint8Array(mnemonic);
614-
this.#isValidMnemonic(mnemonicAsUint8Array);
614+
this.#assertValidMnemonic(mnemonicAsUint8Array);
615615
this.mnemonic = mnemonicAsUint8Array;
616616

617617
this.seed = await mnemonicToSeed(
@@ -648,12 +648,13 @@ export class HdKeyring implements Keyring {
648648
}
649649

650650
/**
651-
* Validate the mnemonic seed phrase.
651+
* Assert that the mnemonic seed phrase is valid.
652+
* Throws an error if the mnemonic is not a valid BIP39 phrase.
652653
*
653-
* @param mnemonic - The mnemonic seed phrase to validate.
654-
* @throws If the mnemonic is invalid.
654+
* @param mnemonic - The mnemonic seed phrase to validate (as Uint8Array).
655+
* @throws If the mnemonic is not a valid BIP39 secret recovery phrase.
655656
*/
656-
#isValidMnemonic(mnemonic: Uint8Array): void {
657+
#assertValidMnemonic(mnemonic: Uint8Array): void {
657658
const mnemonicString = this.#uint8ArrayToString(mnemonic);
658659
if (!validateMnemonic(mnemonicString, wordlist)) {
659660
throw new Error(

0 commit comments

Comments
 (0)