Skip to content

Commit

Permalink
removed unnecessary awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinZavior committed Dec 17, 2024
1 parent 0ec8b2a commit 07c0048
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions example/lib/bdk_library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BdkLibrary {
Future<Input> 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;
}

Expand All @@ -68,7 +68,6 @@ class BdkLibrary {
List<TransactionDetails> getConfirmedTransactions(Wallet wallet) {
List<TransactionDetails> confirmed = [];
final res = wallet.listTransactions(includeRaw: true);

for (var e in res) {
if (e.confirmationTime != null) confirmed.add(e);
}
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 4 additions & 3 deletions example/lib/wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class _ExampleWalletState extends State<ExampleWallet> {
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}");
Expand All @@ -86,10 +86,11 @@ class _ExampleWalletState extends State<ExampleWallet> {
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}");
Expand Down

0 comments on commit 07c0048

Please sign in to comment.