From c852e3db35eca671e7835117c48e046fc00c9e87 Mon Sep 17 00:00:00 2001 From: Buffrr Date: Sat, 13 Dec 2025 21:14:16 +0100 Subject: [PATCH] Fix lint errors --- Cargo.lock | 8 ++++---- Cargo.toml | 5 +++++ client/Cargo.toml | 4 ++-- client/src/bin/space-cli.rs | 25 ------------------------- client/src/store.rs | 4 ++-- protocol/Cargo.toml | 4 ++-- veritas/Cargo.toml | 4 ++-- veritas/src/lib.rs | 2 +- wallet/Cargo.toml | 4 ++-- wallet/src/builder.rs | 3 +-- wallet/src/lib.rs | 8 ++++---- 11 files changed, 25 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fce6a06..37382e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2332,7 +2332,7 @@ dependencies = [ [[package]] name = "spaces_client" -version = "0.0.8" +version = "0.0.9" dependencies = [ "anyhow", "assert_cmd", @@ -2366,7 +2366,7 @@ dependencies = [ [[package]] name = "spaces_protocol" -version = "0.0.8" +version = "0.0.9" dependencies = [ "bincode", "bitcoin", @@ -2390,7 +2390,7 @@ dependencies = [ [[package]] name = "spaces_veritas" -version = "0.0.7" +version = "0.0.9" dependencies = [ "base64 0.22.1", "bincode", @@ -2408,7 +2408,7 @@ dependencies = [ [[package]] name = "spaces_wallet" -version = "0.0.8" +version = "0.0.9" dependencies = [ "anyhow", "bdk_wallet", diff --git a/Cargo.toml b/Cargo.toml index fc35b08..a35b186 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,3 +2,8 @@ resolver = "2" members = [ "client", "protocol", "veritas", "testutil", "wallet"] + + +[workspace.package] +version = "0.0.9" +edition = "2021" \ No newline at end of file diff --git a/client/Cargo.toml b/client/Cargo.toml index ac0e48b..0b96093 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "spaces_client" -version = "0.0.8" -edition = "2021" +version.workspace = true +edition.workspace = true [[bin]] diff --git a/client/src/bin/space-cli.rs b/client/src/bin/space-cli.rs index 3e89fe6..0118960 100644 --- a/client/src/bin/space-cli.rs +++ b/client/src/bin/space-cli.rs @@ -18,11 +18,9 @@ use jsonrpsee::{ core::{client::Error, ClientError}, http_client::HttpClient, }; -use serde::{Deserialize, Serialize}; use spaces_client::{ auth::{auth_token_from_cookie, auth_token_from_creds, http_client_with_auth}, config::{default_cookie_path, default_spaces_rpc_port, ExtendedNetwork}, - deserialize_base64, format::{ print_error_rpc_response, print_list_bidouts, print_list_spaces_response, print_list_transactions, print_list_unspent, print_list_wallets, print_server_info, @@ -32,7 +30,6 @@ use spaces_client::{ BidParams, ExecuteParams, OpenParams, RegisterParams, RpcClient, RpcWalletRequest, RpcWalletTxBuilder, SendCoinsParams, TransferSpacesParams, }, - serialize_base64, wallets::{AddressKind, WalletResponse}, }; use spaces_protocol::bitcoin::{Amount, FeeRate, OutPoint, Txid}; @@ -369,28 +366,6 @@ struct SpaceCli { client: HttpClient, } -#[derive(Serialize, Deserialize)] -struct SignedDnsUpdate { - serial: u32, - space: String, - #[serde( - serialize_with = "serialize_base64", - deserialize_with = "deserialize_base64" - )] - packet: Vec, - signature: Signature, - #[serde(skip_serializing_if = "Option::is_none")] - proof: Option, -} - -#[derive(Serialize, Deserialize)] -struct Base64Bytes( - #[serde( - serialize_with = "serialize_base64", - deserialize_with = "deserialize_base64" - )] - Vec, -); impl SpaceCli { async fn configure() -> anyhow::Result<(Self, Args)> { diff --git a/client/src/store.rs b/client/src/store.rs index 95a5f63..a43b683 100644 --- a/client/src/store.rs +++ b/client/src/store.rs @@ -89,11 +89,11 @@ impl Store { Ok(Database::new(Box::new(FileBackend::new(file)?), config)?) } - pub fn iter(&self) -> SnapshotIterator { + pub fn iter(&self) -> SnapshotIterator<'_, Sha256Hasher> { return self.0.iter(); } - pub fn write(&self) -> Result { + pub fn write(&self) -> Result> { Ok(self.0.begin_write()?) } diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index 5d30094..60d7712 100644 --- a/protocol/Cargo.toml +++ b/protocol/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "spaces_protocol" -version = "0.0.8" -edition = "2021" +version.workspace = true +edition.workspace = true [dependencies] bitcoin = { version = "0.32.2", features = ["base64", "serde"], default-features = false } diff --git a/veritas/Cargo.toml b/veritas/Cargo.toml index 5092c8f..e19ac08 100644 --- a/veritas/Cargo.toml +++ b/veritas/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "spaces_veritas" -version = "0.0.7" -edition = "2021" +version.workspace = true +edition.workspace = true [lib] crate-type = ["cdylib", "rlib"] diff --git a/veritas/src/lib.rs b/veritas/src/lib.rs index 221a6f3..f530923 100644 --- a/veritas/src/lib.rs +++ b/veritas/src/lib.rs @@ -103,7 +103,7 @@ impl Veritas { } impl Proof { - pub fn iter(&self) -> ProofIter { + pub fn iter(&self) -> ProofIter<'_> { ProofIter { inner: self.inner.iter(), } diff --git a/wallet/Cargo.toml b/wallet/Cargo.toml index d1ff2b8..1854f52 100644 --- a/wallet/Cargo.toml +++ b/wallet/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "spaces_wallet" -version = "0.0.8" -edition = "2021" +version.workspace = true +edition.workspace = true [dependencies] spaces_protocol = { path = "../protocol", features = ["std"], version = "*" } diff --git a/wallet/src/builder.rs b/wallet/src/builder.rs index 5f94516..f41a3e0 100644 --- a/wallet/src/builder.rs +++ b/wallet/src/builder.rs @@ -405,7 +405,6 @@ impl Builder { if !coin_transfers.is_empty() { for coin in coin_transfers { builder.add_send(coin)?; - vout += 1; } } @@ -720,7 +719,7 @@ impl Builder { wallet: &mut SpacesWallet, unspendables: Vec, confirmed_only: bool, - ) -> anyhow::Result { + ) -> anyhow::Result> { let fee_rate = self .fee_rate .as_ref() diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index 82ea6b2..0ebf947 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -256,7 +256,7 @@ impl SpacesWallet { }) } - pub fn get_tx(&mut self, txid: Txid) -> Option { + pub fn get_tx(&mut self, txid: Txid) -> Option> { self.internal.get_tx(txid) } @@ -281,7 +281,7 @@ impl SpacesWallet { }) } - pub fn transactions(&self) -> impl Iterator + '_ { + pub fn transactions(&self) -> impl Iterator> + '_ { self.internal .transactions() .filter(|tx| !is_revert_tx(tx) && self.internal.spk_index().is_tx_relevant(&tx.tx_node)) @@ -299,7 +299,7 @@ impl SpacesWallet { &mut self, unspendables: Vec, confirmed_only: bool, - ) -> anyhow::Result> { + ) -> anyhow::Result> { self.create_builder(unspendables, None, confirmed_only) } @@ -530,7 +530,7 @@ impl SpacesWallet { /// /// This is used to monitor bid txs in the mempool /// to check if they have been replaced. - pub fn unconfirmed_bids(&mut self) -> anyhow::Result> { + pub fn unconfirmed_bids(&mut self) -> anyhow::Result, OutPoint)>> { let txids: Vec<_> = { let unconfirmed: Vec<_> = self .transactions()