File tree Expand file tree Collapse file tree
packages/keyring-eth-hd/src Expand file tree Collapse file tree Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments