Skip to content

Commit

Permalink
improve: Simplify wallet key type (#951)
Browse files Browse the repository at this point in the history
The type is correctly filtered within getSigner(), but it causes
unnecessary type annoyances when reading the key type from the
environment or on the command-line.
  • Loading branch information
pxrl authored Sep 29, 2023
1 parent c210556 commit 692685a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/SignerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type SignerOptions = {
* The type of wallet to use.
* @note If using a GCKMS wallet, the gckmsKeys parameter must be set.
*/
keyType: "mnemonic" | "privateKey" | "gckms";
keyType: string;
/**
* Whether or not to clear the mnemonic/private key from the env after retrieving the signer.
* @note Not including this parameter or setting it to false will not clear the mnemonic/private key from the env.
Expand Down Expand Up @@ -42,7 +42,7 @@ export async function getSigner({ keyType, gckmsKeys, cleanEnv }: SignerOptions)
wallet = await getGckmsSigner(gckmsKeys);
break;
default:
throw new Error("Must define mnemonic, privatekey or gckms for wallet");
throw new Error(`getSigner: Unsupported key type (${keyType})`);
}
if (!wallet) {
throw new Error("Must define mnemonic, privatekey or gckms for wallet");
Expand Down

0 comments on commit 692685a

Please sign in to comment.