Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@

resolver = "2"
members = [ "client", "protocol", "veritas", "testutil", "wallet"]


[workspace.package]
version = "0.0.9"
edition = "2021"
4 changes: 2 additions & 2 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "spaces_client"
version = "0.0.8"
edition = "2021"
version.workspace = true
edition.workspace = true


[[bin]]
Expand Down
25 changes: 0 additions & 25 deletions client/src/bin/space-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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};
Expand Down Expand Up @@ -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<u8>,
signature: Signature,
#[serde(skip_serializing_if = "Option::is_none")]
proof: Option<Base64Bytes>,
}

#[derive(Serialize, Deserialize)]
struct Base64Bytes(
#[serde(
serialize_with = "serialize_base64",
deserialize_with = "deserialize_base64"
)]
Vec<u8>,
);

impl SpaceCli {
async fn configure() -> anyhow::Result<(Self, Args)> {
Expand Down
4 changes: 2 additions & 2 deletions client/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ impl Store {
Ok(Database::new(Box::new(FileBackend::new(file)?), config)?)
}

pub fn iter(&self) -> SnapshotIterator<Sha256Hasher> {
pub fn iter(&self) -> SnapshotIterator<'_, Sha256Hasher> {
return self.0.iter();
}

pub fn write(&self) -> Result<WriteTx> {
pub fn write(&self) -> Result<WriteTx<'_>> {
Ok(self.0.begin_write()?)
}

Expand Down
4 changes: 2 additions & 2 deletions protocol/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions veritas/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion veritas/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl Veritas {
}

impl Proof {
pub fn iter(&self) -> ProofIter {
pub fn iter(&self) -> ProofIter<'_> {
ProofIter {
inner: self.inner.iter(),
}
Expand Down
4 changes: 2 additions & 2 deletions wallet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 = "*" }
Expand Down
3 changes: 1 addition & 2 deletions wallet/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ impl Builder {
if !coin_transfers.is_empty() {
for coin in coin_transfers {
builder.add_send(coin)?;
vout += 1;
}
}

Expand Down Expand Up @@ -720,7 +719,7 @@ impl Builder {
wallet: &mut SpacesWallet,
unspendables: Vec<OutPoint>,
confirmed_only: bool,
) -> anyhow::Result<BuilderIterator> {
) -> anyhow::Result<BuilderIterator<'_>> {
let fee_rate = self
.fee_rate
.as_ref()
Expand Down
8 changes: 4 additions & 4 deletions wallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl SpacesWallet {
})
}

pub fn get_tx(&mut self, txid: Txid) -> Option<WalletTx> {
pub fn get_tx(&mut self, txid: Txid) -> Option<WalletTx<'_>> {
self.internal.get_tx(txid)
}

Expand All @@ -281,7 +281,7 @@ impl SpacesWallet {
})
}

pub fn transactions(&self) -> impl Iterator<Item=WalletTx> + '_ {
pub fn transactions(&self) -> impl Iterator<Item=WalletTx<'_>> + '_ {
self.internal
.transactions()
.filter(|tx| !is_revert_tx(tx) && self.internal.spk_index().is_tx_relevant(&tx.tx_node))
Expand All @@ -299,7 +299,7 @@ impl SpacesWallet {
&mut self,
unspendables: Vec<OutPoint>,
confirmed_only: bool,
) -> anyhow::Result<TxBuilder<SpacesAwareCoinSelection>> {
) -> anyhow::Result<TxBuilder<'_, SpacesAwareCoinSelection>> {
self.create_builder(unspendables, None, confirmed_only)
}

Expand Down Expand Up @@ -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<Vec<(WalletTx, OutPoint)>> {
pub fn unconfirmed_bids(&mut self) -> anyhow::Result<Vec<(WalletTx<'_>, OutPoint)>> {
let txids: Vec<_> = {
let unconfirmed: Vec<_> = self
.transactions()
Expand Down
Loading