From 07c00487b1279d51727a746e267223d2ec24a700 Mon Sep 17 00:00:00 2001 From: BitcoinZavior Date: Tue, 17 Dec 2024 00:19:00 -0500 Subject: [PATCH] removed unnecessary awaits --- example/lib/bdk_library.dart | 5 ++--- example/lib/wallet.dart | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/lib/bdk_library.dart b/example/lib/bdk_library.dart index db4ecce..702cf26 100644 --- a/example/lib/bdk_library.dart +++ b/example/lib/bdk_library.dart @@ -52,7 +52,7 @@ class BdkLibrary { Future getPsbtInput( Wallet wallet, LocalUtxo utxo, bool onlyWitnessUtxo) async { final input = - await wallet.getPsbtInput(utxo: utxo, onlyWitnessUtxo: onlyWitnessUtxo); + wallet.getPsbtInput(utxo: utxo, onlyWitnessUtxo: onlyWitnessUtxo); return input; } @@ -68,7 +68,6 @@ class BdkLibrary { List getConfirmedTransactions(Wallet wallet) { List confirmed = []; final res = wallet.listTransactions(includeRaw: true); - for (var e in res) { if (e.confirmationTime != null) confirmed.add(e); } @@ -103,7 +102,7 @@ class BdkLibrary { .addRecipient(script, BigInt.from(amountSat)) .feeRate(feeRate.satPerVb) .finish(wallet); - final isFinalized = await wallet.sign(psbt: psbt); + final isFinalized = wallet.sign(psbt: psbt); if (isFinalized) { final tx = psbt.extractTx(); final res = await blockchain.broadcast(transaction: tx); diff --git a/example/lib/wallet.dart b/example/lib/wallet.dart index 159e368..3e47532 100644 --- a/example/lib/wallet.dart +++ b/example/lib/wallet.dart @@ -64,7 +64,7 @@ class _ExampleWalletState extends State { displayText = "You have ${unConfirmed.length} unConfirmed transactions"; }); for (var e in unConfirmed) { - final txOut = await e.transaction!.output(); + final txOut = e.transaction!.output(); if (kDebugMode) { print(" txid: ${e.txid}"); print(" fee: ${e.fee}"); @@ -86,10 +86,11 @@ class _ExampleWalletState extends State { print(" txid: ${e.txid}"); print(" confirmationTime: ${e.confirmationTime?.timestamp}"); print(" confirmationTime Height: ${e.confirmationTime?.height}"); - final txIn = await e.transaction!.input(); - final txOut = await e.transaction!.output(); + final txIn = e.transaction!.input(); + final txOut = e.transaction!.output(); print("=============TxIn=============="); for (var e in txIn) { + print(" script: ${e.scriptSig}"); print(" previousOutout Txid: ${e.previousOutput.txid}"); print(" previousOutout vout: ${e.previousOutput.vout}"); print(" witness: ${e.witness}");