Skip to content

Commit 568e4ca

Browse files
committed
fix(clippy): fix some formatting issues
1 parent 37b0f7b commit 568e4ca

File tree

5 files changed

+28
-16
lines changed

5 files changed

+28
-16
lines changed

examples/example_wallet_electrum/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ fn main() -> Result<(), anyhow::Error> {
9494
let (_, internal_keymap) = Descriptor::parse_descriptor(&secp, INTERNAL_DESC)?;
9595
let key_map = external_keymap.into_iter().chain(internal_keymap).collect();
9696

97-
// It's using the signer implementation from `test_utils`, you should implement your own signing implementation for `KeyMap`.
97+
// It's using the signer implementation from `test_utils`, you should implement your own signing
98+
// implementation for `KeyMap`.
9899
let signer = bdk_wallet::test_utils::SignerWrapper::new(key_map);
99100
let _ = psbt.sign(&signer, &secp);
100101

examples/example_wallet_esplora_async/src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ use std::{collections::BTreeSet, io::Write};
33
use anyhow::Ok;
44
use bdk_esplora::{esplora_client, EsploraAsyncExt};
55
use bdk_wallet::{
6-
bitcoin::{Amount, Network}, miniscript::Descriptor, rusqlite::Connection, KeychainKind, SignOptions, Wallet
6+
bitcoin::{Amount, Network},
7+
miniscript::Descriptor,
8+
rusqlite::Connection,
9+
KeychainKind, SignOptions, Wallet,
710
};
811

912
const SEND_AMOUNT: Amount = Amount::from_sat(5000);
@@ -85,7 +88,8 @@ async fn main() -> Result<(), anyhow::Error> {
8588
let (_, internal_keymap) = Descriptor::parse_descriptor(&secp, INTERNAL_DESC)?;
8689
let key_map = external_keymap.into_iter().chain(internal_keymap).collect();
8790

88-
// It's using the signer implementation from `test_utils`, you should implement your own signing implementation for `KeyMap`.
91+
// It's using the signer implementation from `test_utils`, you should implement your own signing
92+
// implementation for `KeyMap`.
8993
let signer = bdk_wallet::test_utils::SignerWrapper::new(key_map);
9094
let _ = psbt.sign(&signer, &secp);
9195

examples/example_wallet_esplora_blocking/src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ use std::{collections::BTreeSet, io::Write};
22

33
use bdk_esplora::{esplora_client, EsploraExt};
44
use bdk_wallet::{
5-
bitcoin::{Amount, Network}, file_store::Store, miniscript::Descriptor, KeychainKind, SignOptions, Wallet
5+
bitcoin::{Amount, Network},
6+
file_store::Store,
7+
miniscript::Descriptor,
8+
KeychainKind, SignOptions, Wallet,
69
};
710

811
const DB_MAGIC: &str = "bdk_wallet_esplora_example";
@@ -85,7 +88,8 @@ fn main() -> Result<(), anyhow::Error> {
8588
let (_, internal_keymap) = Descriptor::parse_descriptor(&secp, INTERNAL_DESC)?;
8689
let key_map = external_keymap.into_iter().chain(internal_keymap).collect();
8790

88-
// It's using the signer implementation from `test_utils`, you should implement your own signing implementation for `KeyMap`.
91+
// It's using the signer implementation from `test_utils`, you should implement your own signing
92+
// implementation for `KeyMap`.
8993
let signer = bdk_wallet::test_utils::SignerWrapper::new(key_map);
9094
let _ = psbt.sign(&signer, &secp);
9195

wallet/tests/psbt.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ fn test_psbt_malformed_psbt_input_segwit() {
3939
let _ = psbt.sign(&signer, &secp).unwrap();
4040
}
4141

42-
// FIXME: (@leonardo) this expect an error from `finalize_psbt` method, should be fixed when removing the `SignerErrors`
42+
// FIXME: (@leonardo) this expect an error from `finalize_psbt` method, should be fixed when
43+
// removing the `SignerErrors`
4344
#[test]
4445
#[should_panic(expected = "InputIndexOutOfRange")]
4546
fn test_psbt_malformed_tx_input() {
@@ -61,9 +62,9 @@ fn test_psbt_malformed_tx_input() {
6162
let _ = wallet.finalize_psbt(&mut psbt, options).unwrap();
6263
}
6364

64-
// FIXME: (@leonardo) this test needs a refactoring, it fails due to rust-bitcoin's `spend_utxo` method while signing,
65-
// it adds an input field from BIP-174 PSBT which is missing the `witness_utxo` field. If this input field is not added
66-
// the signing works successfully.
65+
// FIXME: (@leonardo) this test needs a refactoring, it fails due to rust-bitcoin's `spend_utxo`
66+
// method while signing, it adds an input field from BIP-174 PSBT which is missing the
67+
// `witness_utxo` field. If this input field is not added the signing works successfully.
6768
// see: https://github.com/rust-bitcoin/rust-bitcoin/blob/ef5e3256dfafd84d40cabb0c09dd3f49ea117c61/bitcoin/src/psbt/mod.rs#L621-L633
6869
#[test]
6970
#[ignore = "FIXME: it needs refactoring, in order to properly use a finalized input and not one missing `witness_utxo` field."]
@@ -181,15 +182,14 @@ fn test_psbt_fee_rate_with_missing_txout() {
181182
}
182183

183184
#[test]
184-
// #[ignore = "FIXME: it needs refactoring, how should we handle the expected behavior of adding external signers, and usage of wrong internal key ?"]
185+
// #[ignore = "FIXME: it needs refactoring, how should we handle the expected behavior of adding
186+
// external signers, and usage of wrong internal key ?"]
185187
fn test_psbt_multiple_internalkey_signers() {
186-
187188
use bdk_wallet::KeychainKind;
188189
use bitcoin::key::TapTweak;
189190
use bitcoin::secp256k1::{schnorr, Keypair, Message, Secp256k1, XOnlyPublicKey};
190191
use bitcoin::sighash::{Prevouts, SighashCache, TapSighashType};
191192
use bitcoin::{PrivateKey, TxOut};
192-
193193

194194
let secp = Secp256k1::new();
195195
let wif = "cNJmN3fH9DDbDt131fQNkVakkpzawJBSeybCUNmP1BovpmGQ45xG";
@@ -226,7 +226,9 @@ fn test_psbt_multiple_internalkey_signers() {
226226
let signer = get_wallet_signer(&desc, Some(change_desc));
227227
let _ = psbt.sign(&signer, &secp).unwrap();
228228

229-
let finalized = wallet.finalize_psbt(&mut psbt, SignOptions::default()).unwrap();
229+
let finalized = wallet
230+
.finalize_psbt(&mut psbt, SignOptions::default())
231+
.unwrap();
230232
assert!(finalized);
231233

232234
// To verify, we need the signature, message, and pubkey

wallet/tests/wallet.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3264,7 +3264,8 @@ fn test_signing_only_one_of_multiple_inputs() {
32643264
)
32653265
}
32663266

3267-
// FIXME: (@leonardo) this test should probably be removed when `SignOptions` is fully removed. The `try_finalize` option is only used in `Wallet::sign` method.
3267+
// FIXME: (@leonardo) this test should probably be removed when `SignOptions` is fully removed. The
3268+
// `try_finalize` option is only used in `Wallet::sign` method.
32683269
#[test]
32693270
fn test_try_finalize_sign_option() {
32703271
let secp = Secp256k1::new();
@@ -3300,7 +3301,8 @@ fn test_try_finalize_sign_option() {
33003301
}
33013302
}
33023303

3303-
// FIXME: (@leonardo) this test should probably be removed when `SignOptions` is fully removed. The `try_finalize` option is only used in `Wallet::sign` method.
3304+
// FIXME: (@leonardo) this test should probably be removed when `SignOptions` is fully removed. The
3305+
// `try_finalize` option is only used in `Wallet::sign` method.
33043306
#[test]
33053307
fn test_taproot_try_finalize_sign_option() {
33063308
let secp = Secp256k1::new();
@@ -4058,7 +4060,6 @@ fn test_taproot_script_spend_sign_include_some_leaves() {
40584060

40594061
#[test]
40604062
fn test_taproot_script_spend_sign_exclude_some_leaves() {
4061-
40624063
use bitcoin::taproot::TapLeafHash;
40634064

40644065
let secp = Secp256k1::new();

0 commit comments

Comments
 (0)