From 77ef41838fd21689dc5d637014e03b51928c225c Mon Sep 17 00:00:00 2001 From: Nishant Ghodke Date: Wed, 26 Jul 2023 15:57:18 +0530 Subject: [PATCH] refactor: remove unncessary try..catch block --- packages/sdk/src/wallet/Ordit.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/sdk/src/wallet/Ordit.ts b/packages/sdk/src/wallet/Ordit.ts index 19c79b89..60aae6a9 100644 --- a/packages/sdk/src/wallet/Ordit.ts +++ b/packages/sdk/src/wallet/Ordit.ts @@ -228,21 +228,15 @@ export class Ordit { const psbtHex = psbt.toHex(); - //TODO: check if psbt has been signed + if (finalized) { + psbt.finalizeAllInputs(); - try { - if (finalized) { - psbt.finalizeAllInputs(); - - const signedHex = psbt.extractTransaction().toHex(); - - return signedHex; - } + const signedHex = psbt.extractTransaction().toHex(); - return psbtHex; - } catch (error) { - throw new Error("Cannot finalize the inputs.", error); + return signedHex; } + + return psbtHex; } signMessage(message: string) {