From d01bda54a687b9768aa98c09f4041f33e9d1fc6a Mon Sep 17 00:00:00 2001 From: nazreen Date: Mon, 16 Dec 2024 22:07:55 +0800 Subject: [PATCH] error when no solana secret key passed in --- examples/oft-solana/tasks/common/wire.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/oft-solana/tasks/common/wire.ts b/examples/oft-solana/tasks/common/wire.ts index f90f6281c..1249b2864 100644 --- a/examples/oft-solana/tasks/common/wire.ts +++ b/examples/oft-solana/tasks/common/wire.ts @@ -70,14 +70,13 @@ task(TASK_LZ_OAPP_WIRE) // // - if (args.solanaSecretKey == null) { - logger.warn( - `Missing --solana-secret-key CLI argument. A random keypair will be generated and interaction with solana programs will not be possible` - ) + if (!args.solanaSecretKey) { + logger.error('Missing --solana-secret-key CLI argument.') + return } // The first step is to create the user Keypair from the secret passed in - const wallet = args.solanaSecretKey ?? Keypair.generate() + const wallet = args.solanaSecretKey const userAccount = wallet.publicKey // Then we grab the programId from the args