From 8e51756a3ae770d0e271c39839765c9c8a2de733 Mon Sep 17 00:00:00 2001 From: thunderbiscuit Date: Tue, 14 Mar 2023 08:18:50 -0400 Subject: [PATCH] Fix clippy errors --- Cargo.lock | 304 +----------------------------------------- bdk-ffi/src/bdk.udl | 4 +- bdk-ffi/src/wallet.rs | 9 +- 3 files changed, 15 insertions(+), 302 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0310efa..8eb14e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,15 +19,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anyhow" version = "1.0.69" @@ -96,17 +87,6 @@ dependencies = [ "syn", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -163,16 +143,6 @@ dependencies = [ "uniffi", ] -[[package]] -name = "bdk-ffi-bindgen" -version = "0.2.0" -dependencies = [ - "anyhow", - "camino", - "structopt", - "uniffi_bindgen 0.21.1", -] - [[package]] name = "bdk-macros" version = "0.6.0" @@ -331,60 +301,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim 0.8.0", - "textwrap 0.11.0", - "unicode-width", - "vec_map", -] - -[[package]] -name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "atty", - "bitflags", - "clap_derive", - "clap_lex", - "indexmap", - "once_cell", - "strsim 0.10.0", - "termcolor", - "textwrap 0.16.0", -] - -[[package]] -name = "clap_derive" -version = "3.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" -dependencies = [ - "heck 0.4.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "crc32fast" version = "1.3.2" @@ -519,17 +435,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "goblin" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" -dependencies = [ - "log", - "plain", - "scroll", -] - [[package]] name = "goblin" version = "0.6.1" @@ -559,30 +464,12 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "idna" version = "0.2.1" @@ -594,16 +481,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown", -] - [[package]] name = "instant" version = "0.1.12" @@ -640,12 +517,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - [[package]] name = "libc" version = "0.2.139" @@ -766,12 +637,6 @@ version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" -[[package]] -name = "os_str_bytes" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - [[package]] name = "parking_lot" version = "0.11.2" @@ -833,30 +698,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.51" @@ -1124,42 +965,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "structopt" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" -dependencies = [ - "clap 2.34.0", - "lazy_static", - "structopt-derive", -] - -[[package]] -name = "structopt-derive" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" -dependencies = [ - "heck 0.3.3", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "syn" version = "1.0.107" @@ -1171,30 +976,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" version = "1.0.39" @@ -1277,18 +1058,6 @@ dependencies = [ "smallvec 0.6.14", ] -[[package]] -name = "unicode-segmentation" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - [[package]] name = "uniffi" version = "0.23.0" @@ -1296,35 +1065,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f71cc01459bc34cfe43fabf32b39f1228709bc6db1b3a664a92940af3d062376" dependencies = [ "anyhow", - "uniffi_bindgen 0.23.0", + "uniffi_bindgen", "uniffi_build", "uniffi_core", "uniffi_macros", ] -[[package]] -name = "uniffi_bindgen" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d46080a4840abccf7c0cce21931dae53215cbd7dd969b5e63c486235ce91a2a" -dependencies = [ - "anyhow", - "askama", - "bincode", - "camino", - "clap 3.2.23", - "fs-err", - "goblin 0.5.4", - "heck 0.4.1", - "once_cell", - "paste", - "serde", - "serde_json", - "toml", - "uniffi_meta 0.21.1", - "weedle2", -] - [[package]] name = "uniffi_bindgen" version = "0.23.0" @@ -1337,14 +1083,14 @@ dependencies = [ "camino", "fs-err", "glob", - "goblin 0.6.1", - "heck 0.4.1", + "goblin", + "heck", "once_cell", "paste", "serde", "serde_json", "toml", - "uniffi_meta 0.23.0", + "uniffi_meta", "uniffi_testing", "weedle2", ] @@ -1357,17 +1103,7 @@ checksum = "0ee1a28368ff3d83717e3d3e2e15a66269c43488c3f036914131bb68892f29fb" dependencies = [ "anyhow", "camino", - "uniffi_bindgen 0.23.0", -] - -[[package]] -name = "uniffi_checksum_derive" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9" -dependencies = [ - "quote", - "syn", + "uniffi_bindgen", ] [[package]] @@ -1412,18 +1148,7 @@ dependencies = [ "syn", "toml", "uniffi_build", - "uniffi_meta 0.23.0", -] - -[[package]] -name = "uniffi_meta" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38" -dependencies = [ - "serde", - "siphasher", - "uniffi_checksum_derive 0.21.1", + "uniffi_meta", ] [[package]] @@ -1434,7 +1159,7 @@ checksum = "66fdab2c436aed7a6391bec64204ec33948bfed9b11b303235740771f85c4ea6" dependencies = [ "serde", "siphasher", - "uniffi_checksum_derive 0.23.0", + "uniffi_checksum_derive", ] [[package]] @@ -1494,12 +1219,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.4" @@ -1620,15 +1339,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index f38ffe9..3897a21 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -190,8 +190,8 @@ dictionary OutPoint { dictionary TxIn { OutPoint previous_output; Script script_sig; - u32 sequence; - sequence> witness; + u32 sequence; + sequence> witness; }; dictionary TxOut { diff --git a/bdk-ffi/src/wallet.rs b/bdk-ffi/src/wallet.rs index beeb216..b80bd90 100644 --- a/bdk-ffi/src/wallet.rs +++ b/bdk-ffi/src/wallet.rs @@ -3,7 +3,10 @@ use bdk::bitcoin::{Address as BdkAddress, Network, OutPoint as BdkOutPoint, Sequ use bdk::database::any::AnyDatabase; use bdk::database::{AnyDatabaseConfig, ConfigurableDatabase}; use bdk::wallet::tx_builder::ChangeSpendPolicy; -use bdk::{FeeRate, SignOptions, SyncOptions as BdkSyncOptions, Wallet as BdkWallet}; +use bdk::{ + FeeRate, LocalUtxo as BdkLocalUtxo, SignOptions, SyncOptions as BdkSyncOptions, + Wallet as BdkWallet, +}; use std::collections::HashSet; use std::ops::Deref; use std::str::FromStr; @@ -128,8 +131,8 @@ impl Wallet { /// Return the list of unspent outputs of this wallet. Note that this method only operates on the internal database, /// which first needs to be Wallet.sync manually. pub(crate) fn list_unspent(&self) -> Result, BdkError> { - let unspents = self.get_wallet().list_unspent()?; - Ok(unspents.iter().map(|u| LocalUtxo::from_utxo(u)).collect()) + let unspents: Vec = self.get_wallet().list_unspent()?; + Ok(unspents.iter().map(LocalUtxo::from_utxo).collect()) } }