From 2c0e3ea4ade4b154f462aba12f7600eb5ddd65a1 Mon Sep 17 00:00:00 2001 From: Hunter Trujillo Date: Thu, 15 Feb 2024 08:14:23 -0700 Subject: [PATCH 1/3] WASM fixes. --- Cargo.lock | 67 ++++++++++++++++++++++++-------------------- Cargo.toml | 5 ++-- src/lib.rs | 2 ++ src/resolvers/mod.rs | 4 +++ 4 files changed, 45 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88870e1..231fef1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,9 +125,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.5" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -139,9 +139,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -269,7 +269,7 @@ dependencies = [ "bitcoin_hashes", "hex-conservative", "hex_lit", - "secp256k1", + "secp256k1 0.28.0", "serde", ] @@ -482,8 +482,7 @@ dependencies = [ [[package]] name = "bp-wallet" version = "0.11.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a0baa9e09b52085f7d1cd27df92395e06a8016a8ccb8cdc68556ba2b5ac831" +source = "git+https://github.com/cryptoquick/bp-wallet?branch=HB/remove-esplora-from-default-features#be01f35ca6fc714749a5018825646cac3927b6d0" dependencies = [ "amplify", "bp-esplora", @@ -558,9 +557,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.12" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ "clap_builder", "clap_derive", @@ -568,21 +567,21 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.12" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.0", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", @@ -592,9 +591,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -717,7 +716,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 2.0.43", ] @@ -819,9 +818,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -1017,9 +1016,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -1185,12 +1184,12 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys 0.52.0", ] @@ -1508,9 +1507,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -1520,9 +1519,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -1813,7 +1812,6 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ - "bitcoin_hashes", "rand", "secp256k1-sys 0.8.1", "serde", @@ -1825,6 +1823,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" dependencies = [ + "bitcoin_hashes", "rand", "secp256k1-sys 0.9.1", "serde", @@ -2123,6 +2122,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "syn" version = "1.0.109" @@ -2181,9 +2186,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] diff --git a/Cargo.toml b/Cargo.toml index 030a915..04087fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ members = [ ] default-members = [ "psbt", - "cli", "fs", "." ] @@ -18,7 +17,7 @@ keywords = ["bitcoin", "lightning", "rgb", "smart-contracts", "lnp-bp"] categories = ["cryptography::cryptocurrencies"] authors = ["Dr Maxim Orlovsky "] homepage = "https://lnp-bp.org" -repository = "https://github.com/RGB-WG/rgb-wallet" +repository = "https://github.com/RGB-WG/rgb" rust-version = "1.67" # Due to strict encoding library edition = "2021" license = "Apache-2.0" @@ -64,6 +63,7 @@ license.workspace = true [lib] name = "rgb_rt" +crate-type = ["cdylib", "rlib"] [dependencies] amplify = { workspace = true } @@ -101,3 +101,4 @@ features = [ "all" ] rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "v0.11" } rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.11" } rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.11" } +bp-wallet = { git = "https://github.com/cryptoquick/bp-wallet", branch = "HB/remove-esplora-from-default-features" } diff --git a/src/lib.rs b/src/lib.rs index 046dc1f..cb356e9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,5 +35,7 @@ mod resolvers; pub use descriptor::{DescriptorRgb, RgbDescr, RgbKeychain, TapTweakAlreadyAssigned, TapretKey}; pub use pay::{CompletionError, CompositionError, PayError, TransferParams}; +#[cfg(feature = "electrum")] +#[cfg(feature = "esplora_blocking")] pub use resolvers::*; pub use runtime::{ContractOutpointsFilter, Runtime, RuntimeError}; diff --git a/src/resolvers/mod.rs b/src/resolvers/mod.rs index 8a497ed..1280abf 100644 --- a/src/resolvers/mod.rs +++ b/src/resolvers/mod.rs @@ -19,10 +19,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#[cfg(feature = "electrum")] +#[cfg(feature = "esplora_blocking")] mod any; #[cfg(feature = "esplora_blocking")] pub mod esplora_blocking; #[cfg(feature = "electrum")] pub mod electrum; +#[cfg(feature = "electrum")] +#[cfg(feature = "esplora_blocking")] pub use any::AnyResolver; From b3b083f216513421812ae6c7bdc469c20a743ab4 Mon Sep 17 00:00:00 2001 From: Hunter Trujillo Date: Thu, 15 Feb 2024 08:20:08 -0700 Subject: [PATCH 2/3] Switch to patching bp-wallet 0.11 branch. --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 231fef1..7cc3eb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -482,7 +482,7 @@ dependencies = [ [[package]] name = "bp-wallet" version = "0.11.0-beta.4" -source = "git+https://github.com/cryptoquick/bp-wallet?branch=HB/remove-esplora-from-default-features#be01f35ca6fc714749a5018825646cac3927b6d0" +source = "git+https://github.com/BP-WG/bp-wallet?branch=v0.11#9d1cf14c1a3c6810827f1de9b887103f3f178ac8" dependencies = [ "amplify", "bp-esplora", diff --git a/Cargo.toml b/Cargo.toml index 04087fd..5e95d5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -101,4 +101,4 @@ features = [ "all" ] rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "v0.11" } rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.11" } rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.11" } -bp-wallet = { git = "https://github.com/cryptoquick/bp-wallet", branch = "HB/remove-esplora-from-default-features" } +bp-wallet = { git = "https://github.com/BP-WG/bp-wallet", branch = "v0.11" } From ce03e36961b8442894535fae08d8f6c9f5f95b5c Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Mon, 26 Feb 2024 21:00:15 +0100 Subject: [PATCH 3/3] chore: fix feature flag composition --- src/lib.rs | 3 +-- src/resolvers/mod.rs | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index cb356e9..5ff46a6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,7 +35,6 @@ mod resolvers; pub use descriptor::{DescriptorRgb, RgbDescr, RgbKeychain, TapTweakAlreadyAssigned, TapretKey}; pub use pay::{CompletionError, CompositionError, PayError, TransferParams}; -#[cfg(feature = "electrum")] -#[cfg(feature = "esplora_blocking")] +#[cfg(any(feature = "electrum", feature = "esplora_blocking"))] pub use resolvers::*; pub use runtime::{ContractOutpointsFilter, Runtime, RuntimeError}; diff --git a/src/resolvers/mod.rs b/src/resolvers/mod.rs index 1280abf..8cdb5a3 100644 --- a/src/resolvers/mod.rs +++ b/src/resolvers/mod.rs @@ -19,14 +19,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[cfg(feature = "electrum")] -#[cfg(feature = "esplora_blocking")] +#[cfg(any(feature = "electrum", feature = "esplora_blocking"))] mod any; #[cfg(feature = "esplora_blocking")] pub mod esplora_blocking; #[cfg(feature = "electrum")] pub mod electrum; -#[cfg(feature = "electrum")] -#[cfg(feature = "esplora_blocking")] +#[cfg(any(feature = "electrum", feature = "esplora_blocking"))] pub use any::AnyResolver;