From 36b75aa677611879ba14dafebfea9ace554c2356 Mon Sep 17 00:00:00 2001 From: Paul <108695806+pxrl@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:48:08 +0200 Subject: [PATCH] fix: Restore privateKey wallet validation (#968) privateKey is case sensitive. --- src/utils/CLIUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/CLIUtils.ts b/src/utils/CLIUtils.ts index 9c84ea3a6..d0aa9f9db 100644 --- a/src/utils/CLIUtils.ts +++ b/src/utils/CLIUtils.ts @@ -10,9 +10,9 @@ export function retrieveSignerFromCLIArgs(): Promise { // Call into the process' argv to retrieve the CLI args. const args = minimist(process.argv.slice(2)); // Resolve the wallet type & verify that it is valid. - const keyType = ((args.wallet as string) ?? "MNEMONIC").toLowerCase(); + const keyType = (args.wallet as string) ?? "mnemonic"; if (!isValidKeyType(keyType)) { - throw new Error("Must define mnemonic, privatekey or gckms for wallet"); + throw new Error(`Unsupported key type (${keyType}); expected "mnemonic", "privateKey" or "gckms"`); } // Build out the signer options to pass to the signer utils. @@ -31,5 +31,5 @@ export function retrieveSignerFromCLIArgs(): Promise { * @returns True if the key type is valid, false otherwise. */ function isValidKeyType(keyType: unknown): keyType is "mnemonic" | "privateKey" | "gckms" { - return ["mnemonic", "privateKey", "gckms"].includes((keyType as string).toLowerCase()); + return ["mnemonic", "privateKey", "gckms"].includes(keyType as string); }