Skip to content

Commit

Permalink
chore: move to v0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Nov 14, 2023
1 parent 0e868b8 commit a198668
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 64 deletions.
57 changes: 26 additions & 31 deletions Cargo.lock

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

17 changes: 12 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = [".", "cli"]
exclude = ["convert"]

[workspace.package]
version = "0.10.0-beta.1"
version = "0.11.0-beta.1"
keywords = ["bitcoin", "wallet", "descriptor-wallet", "psbt", "taproot"]
categories = ["cryptography::cryptocurrencies"]
authors = ["Dr Maxim Orlovsky <[email protected]>"]
Expand All @@ -16,10 +16,10 @@ license = "Apache-2.0"
[workspace.dependencies]
amplify = "4.5.0"
strict_encoding = "2.6.1"
bp-std = "0.10.0-beta.1"
psbt = "=0.10.0-BP-beta.1"
descriptors = "=0.10.0-BP-beta.1"
bp-esplora = "0.10.0"
bp-std = "0.11.0-beta.1"
psbt = "0.11.0-beta.1"
descriptors = "0.11.0-beta.1"
bp-esplora = "0.11.0-beta.1"
serde_crate = { package = "serde", version = "1", features = ["derive"] }
serde_yaml = "0.9.19"
toml = "0.8.2"
Expand Down Expand Up @@ -58,3 +58,10 @@ all = ["esplora", "fs"]
esplora = ["bp-esplora"]
fs = ["serde"]
serde = ["serde_crate", "serde_yaml", "toml", "bp-std/serde"]

[patch.crates-io]
bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
bp-std = { git = "https://github.com/BP-WG/bp-std", branch = "master" }
psbt = { git = "https://github.com/BP-WG/bp-std", branch = "master" }
descriptors = { git = "https://github.com/BP-WG/bp-std", branch = "master" }
bp-esplora = { git = "https://github.com/BP-WG/bp-esplora-client", branch = "master" }
4 changes: 2 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ path = "src/bin/bp.rs"
[dependencies]
amplify = { workspace = true, features = ["serde"] }
strict_encoding = { workspace = true }
bp-wallet = { version = "0.10.0-beta.1", path = "..", features = ["serde", "fs"] }
bp-wallet = { version = "0.11.0-beta.1", path = "..", features = ["serde", "fs"] }
bp-std = { workspace = true, features = ["serde"] }
descriptors = { workspace = true, features = ["serde"] }
psbt = { workspace = true, features = ["serde"] }
bp-esplora = { workspace = true }
base64 = "0.21.4"
log = { workspace = true }
env_logger = "0.10.0"
clap = { version = "4.4.6", features = ["derive", "env"] }
clap = { version = "4.4.8", features = ["derive", "env"] }
shellexpand = "3.1.0"
serde_crate = { workspace = true }
serde_yaml = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<C: Clone + Eq + Debug + Subcommand, O: DescriptorOpts> Args<C, O> {
eprint!("Loading descriptor");
let mut runtime: Runtime<D> = if let Some(d) = self.wallet.descriptor_opts.descriptor() {
eprint!(" from command-line argument ... ");
Runtime::new_standard(d.into(), self.general.chain)
Runtime::new_standard(d.into(), self.general.network)
} else if let Some(wallet_path) = self.wallet.wallet_path.clone() {
eprint!(" from specified wallet directory ... ");
Runtime::load_standard(wallet_path)?
Expand Down
6 changes: 3 additions & 3 deletions cli/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use std::fmt::Debug;
use std::path::{Path, PathBuf};

use bpstd::{Chain, XpubDerivable};
use bpstd::{Network, XpubDerivable};
use clap::ValueHint;
use descriptors::{Descriptor, DescriptorStd, TrKey, Wpkh};
use strict_encoding::Ident;
Expand Down Expand Up @@ -131,7 +131,7 @@ pub struct GeneralOpts {

/// Blockchain to use.
#[arg(short, long, global = true, default_value = "testnet", env = "LNPBP_NETWORK")]
pub chain: Chain,
pub network: Network,
}

impl GeneralOpts {
Expand All @@ -142,7 +142,7 @@ impl GeneralOpts {

pub fn base_dir(&self) -> PathBuf {
let mut dir = self.data_dir.clone();
dir.push(self.chain.to_string());
dir.push(self.network.to_string());
dir
}

Expand Down
4 changes: 2 additions & 2 deletions convert/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ name = "bconv"

[dependencies]
amplify = "4.0.0"
secp256k1 = "0.27.0"
bitcoin = "0.30.1"
secp256k1 = "0.28.0"
bitcoin = "0.31.0"
bp-wallet = { path = ".." }

[patch.crates-io]
Expand Down
4 changes: 2 additions & 2 deletions src/indexers/esplora.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl Indexer for BlockingClient {
.balance
.saturating_add(debit.value.sats().try_into().expect("sats overflow"));
} else if debit.beneficiary.is_unknown() {
Address::with(&s, descriptor.chain())
Address::with(&s, descriptor.network())
.map(|addr| {
debit.beneficiary = Party::Counterparty(addr);
})
Expand All @@ -179,7 +179,7 @@ impl Indexer for BlockingClient {
.balance
.saturating_sub(credit.value.sats().try_into().expect("sats overflow"));
} else if credit.payer.is_unknown() {
Address::with(&s, descriptor.chain())
Address::with(&s, descriptor.network())
.map(|addr| {
credit.payer = Party::Counterparty(addr);
})
Expand Down
14 changes: 7 additions & 7 deletions src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::path::PathBuf;
use std::{error, io};

use amplify::IoError;
use bpstd::{Chain, XpubDerivable};
use bpstd::{Network, XpubDerivable};
use descriptors::{Descriptor, DescriptorStd};

use crate::wallet::fs::Warning;
Expand Down Expand Up @@ -107,7 +107,7 @@ impl<K, D: Descriptor<K>, L2: Layer2> DerefMut for Runtime<D, K, L2> {
}

impl<K, D: Descriptor<K>> Runtime<D, K> {
pub fn new_standard(descr: D, network: Chain) -> Self {
pub fn new_standard(descr: D, network: Network) -> Self {
Runtime {
path: None,
wallet: Wallet::new_standard(descr, network),
Expand All @@ -117,7 +117,7 @@ impl<K, D: Descriptor<K>> Runtime<D, K> {
}

impl<K, D: Descriptor<K>, L2: Layer2> Runtime<D, K, L2> {
pub fn new_layer2(descr: D, l2_descr: L2::Descr, layer2: L2, network: Chain) -> Self {
pub fn new_layer2(descr: D, l2_descr: L2::Descr, layer2: L2, network: Network) -> Self {
Runtime {
path: None,
wallet: Wallet::new_layer2(descr, l2_descr, layer2, network),
Expand Down Expand Up @@ -159,15 +159,15 @@ where for<'de> D: serde::Serialize + serde::Deserialize<'de>

pub fn load_standard_or_init<E>(
data_dir: PathBuf,
chain: Chain,
network: Network,
init: impl FnOnce(LoadError) -> Result<D, E>,
) -> Result<Self, LoadError>
where
LoadError: From<E>,
{
Self::load_standard(data_dir).or_else(|err| {
let descriptor = init(err)?;
Ok(Self::new_standard(descriptor, chain))
Ok(Self::new_standard(descriptor, network))
})
}
}
Expand All @@ -191,7 +191,7 @@ where

pub fn load_layer2_or_init<E1, E2>(
data_dir: PathBuf,
chain: Chain,
network: Network,
init: impl FnOnce(LoadError<L2::LoadError>) -> Result<D, E1>,
init_l2: impl FnOnce() -> Result<(L2, L2::Descr), E2>,
) -> Result<Self, LoadError<L2::LoadError>>
Expand All @@ -202,7 +202,7 @@ where
Self::load_layer2(data_dir).or_else(|err| {
let descriptor = init(err)?;
let (layer2, l2_descr) = init_l2()?;
Ok(Self::new_layer2(descriptor, l2_descr, layer2, chain))
Ok(Self::new_layer2(descriptor, l2_descr, layer2, network))
})
}

Expand Down
Loading

0 comments on commit a198668

Please sign in to comment.