diff --git a/Cargo.lock b/Cargo.lock index 338da3c..febe026 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -83,55 +83,12 @@ dependencies = [ "memchr", ] -[[package]] -name = "anstream" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - [[package]] name = "anstyle" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" -[[package]] -name = "anstyle-parse" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" -dependencies = [ - "anstyle", - "windows-sys 0.59.0", -] - [[package]] name = "anyhow" version = "1.0.93" @@ -144,47 +101,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "askama" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" -dependencies = [ - "askama_derive", - "askama_escape", -] - -[[package]] -name = "askama_derive" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" -dependencies = [ - "askama_parser", - "basic-toml", - "mime", - "mime_guess", - "proc-macro2", - "quote", - "serde", - "syn 2.0.90", -] - -[[package]] -name = "askama_escape" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" - -[[package]] -name = "askama_parser" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" -dependencies = [ - "nom", -] - [[package]] name = "async-trait" version = "0.1.83" @@ -317,15 +233,6 @@ dependencies = [ "url", ] -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bip39" version = "2.1.0" @@ -374,7 +281,7 @@ dependencies = [ [[package]] name = "bitcoin-ffi" version = "0.1.2" -source = "git+https://github.com/bitcoindevkit/bitcoin-ffi.git?rev=4cd8e644dbf4e001d71d5fffb232480fa5ff2246#4cd8e644dbf4e001d71d5fffb232480fa5ff2246" +source = "git+https://github.com/bitcoindevkit/bitcoin-ffi.git?rev=6b1d131#6b1d1315dff8696b5ffeb3e5669f308ade227749" dependencies = [ "bitcoin 0.32.5", "thiserror 1.0.69", @@ -768,7 +675,6 @@ version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ - "anstream", "anstyle", "clap_lex", "strsim 0.11.1", @@ -792,12 +698,6 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" -[[package]] -name = "colorchoice" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" - [[package]] name = "combine" version = "4.6.7" @@ -1664,12 +1564,6 @@ version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - [[package]] name = "itoa" version = "1.0.14" @@ -2440,6 +2334,45 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rinja" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dc4940d00595430b3d7d5a01f6222b5e5b51395d1120bdb28d854bb8abb17a5" +dependencies = [ + "itoa", + "rinja_derive", +] + +[[package]] +name = "rinja_derive" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d9ed0146aef6e2825f1b1515f074510549efba38d71f4554eec32eb36ba18b" +dependencies = [ + "basic-toml", + "memchr", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "rinja_parser", + "rustc-hash", + "serde", + "syn 2.0.90", +] + +[[package]] +name = "rinja_parser" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f9a866e2e00a7a1fb27e46e9e324a6f7c0e7edc4543cae1d38f4e4a100c610" +dependencies = [ + "memchr", + "nom", + "serde", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -3331,12 +3264,13 @@ dependencies = [ [[package]] name = "uniffi" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31bff6daf87277a9014bcdefbc2842b0553392919d1096843c5aad899ca4588" +checksum = "fe34585ac0275accf6c284d0080cc2840f3898c551cda869ec291b5a4218712c" dependencies = [ "anyhow", "camino", + "cargo_metadata", "clap", "uniffi_bindgen", "uniffi_build", @@ -3346,12 +3280,11 @@ dependencies = [ [[package]] name = "uniffi_bindgen" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96061d7e01b185aa405f7c9b134741ab3e50cc6796a47d6fd8ab9a5364b5feed" +checksum = "1a792af1424cc8b3c43b44c1a6cb7935ed1fbe5584a74f70e8bab9799740266d" dependencies = [ "anyhow", - "askama", "camino", "cargo_metadata", "fs-err", @@ -3360,6 +3293,7 @@ dependencies = [ "heck", "once_cell", "paste", + "rinja", "serde", "textwrap", "toml", @@ -3370,47 +3304,43 @@ dependencies = [ [[package]] name = "uniffi_build" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6b86f9b221046af0c533eafe09ece04e2f1ded04ccdc9bba0ec09aec1c52bd" +checksum = "00c4138211f2ae951018fcce6a978e1fcd1a47c3fd0bc0d5472a520520060db1" dependencies = [ "anyhow", "camino", "uniffi_bindgen", ] -[[package]] -name = "uniffi_checksum_derive" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802d2051a700e3ec894c79f80d2705b69d85844dafbbe5d1a92776f8f48b563a" -dependencies = [ - "quote", - "syn 2.0.90", -] - [[package]] name = "uniffi_core" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3210d57d6ab6065ab47a2898dacdb7c606fd6a4156196831fa3bf82e34ac58a6" +checksum = "c18baace68a52666d33d12d73ca335ecf27a302202cefb53b1f974512bb72417" dependencies = [ "anyhow", "bytes", - "camino", - "log", "once_cell", - "paste", "static_assertions", ] +[[package]] +name = "uniffi_internal_macros" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9902d4ed16c65e6c0222241024dd0bfeed07ea3deb7c470eb175e5f5ef406cd" +dependencies = [ + "quote", + "syn 2.0.90", +] + [[package]] name = "uniffi_macros" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58691741080935437dc862122e68d7414432a11824ac1137868de46181a0bd2" +checksum = "9d82c82ef945c51082d8763635334b994e63e77650f09d0fae6d28dd08b1de83" dependencies = [ - "bincode", "camino", "fs-err", "once_cell", @@ -3424,21 +3354,20 @@ dependencies = [ [[package]] name = "uniffi_meta" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7663eacdbd9fbf4a88907ddcfe2e6fa85838eb6dc2418a7d91eebb3786f8e20b" +checksum = "8d6027b971c2aa86350dd180aee9819729c7b99bacd381534511ff29d2c09cea" dependencies = [ "anyhow", - "bytes", "siphasher", - "uniffi_checksum_derive", + "uniffi_internal_macros", ] [[package]] name = "uniffi_testing" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f922465f7566f25f8fe766920205fdfa9a3fcdc209c6bfb7557f0b5bf45b04dd" +checksum = "6301bcb50098dabcd304485318ba73f0f4db5e5d9d3c385c60b967810344ce90" dependencies = [ "anyhow", "camino", @@ -3449,14 +3378,13 @@ dependencies = [ [[package]] name = "uniffi_udl" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef408229a3a407fafa4c36dc4f6ece78a6fb258ab28d2b64bddd49c8cb680f6" +checksum = "52300b7a4ab02dc159a038a13d5bfe27aefbad300d91b0b501b3dda094c1e0a2" dependencies = [ "anyhow", "textwrap", "uniffi_meta", - "uniffi_testing", "weedle2", ] @@ -3541,12 +3469,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - [[package]] name = "valuable" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 8a62b21..c49de69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,17 +18,17 @@ name = "uniffi-bindgen" path = "uniffi-bindgen.rs" [build-dependencies] -uniffi = { version = "0.28.0", features = ["build"] } +uniffi = { version = "0.29.1", features = ["build"] } [dependencies] base64 = "0.22.1" -bitcoin-ffi = { git = "https://github.com/bitcoindevkit/bitcoin-ffi.git", rev = "4cd8e644dbf4e001d71d5fffb232480fa5ff2246" } +bitcoin-ffi = { git = "https://github.com/bitcoindevkit/bitcoin-ffi.git", rev = "6b1d131" } hex = "0.4.3" ohttp = { package = "bitcoin-ohttp", version = "0.6.0" } payjoin = { git = "https://github.com/payjoin/rust-payjoin.git", rev = "bb47c8469146f1a9055b7f850d86f58f2b9627c6", features = ["v1", "io"] } serde_json = "1.0.128" thiserror = "1.0.58" -uniffi = { version = "0.28.0", optional = true } +uniffi = { version = "0.29.1", optional = true } url = "2.5.0" [dev-dependencies] @@ -44,7 +44,7 @@ rustls = "0.22.2" testcontainers = "0.15.0" testcontainers-modules = { version = "0.1.3", features = ["redis"] } tokio = { version = "1.12.0", features = ["full"] } -uniffi = { version = "0.28.0", features = ["bindgen-tests"] } +uniffi = { version = "0.29.1", features = ["bindgen-tests"] } [profile.release-smaller] inherits = "release" diff --git a/src/bitcoin_ffi.rs b/src/bitcoin_ffi.rs index 387fba8..07ec9d7 100644 --- a/src/bitcoin_ffi.rs +++ b/src/bitcoin_ffi.rs @@ -7,12 +7,6 @@ use payjoin::bitcoin; #[cfg(feature = "uniffi")] mod uni { pub use bitcoin_ffi::*; - - uniffi::use_udl_object!(bitcoin_ffi, Script); - uniffi::use_udl_record!(bitcoin_ffi, TxOut); - uniffi::use_udl_record!(bitcoin_ffi, TxIn); - uniffi::use_udl_enum!(bitcoin_ffi, Network); - uniffi::use_udl_record!(bitcoin_ffi, OutPoint); } #[cfg(feature = "uniffi")] diff --git a/src/receive/mod.rs b/src/receive/mod.rs index 657f3df..91e7aa1 100644 --- a/src/receive/mod.rs +++ b/src/receive/mod.rs @@ -49,8 +49,8 @@ impl Receiver { ohttp_keys: OhttpKeys, expire_after: Option, ) -> Result { - let address = - payjoin::bitcoin::Address::from_str(address.as_str())?.require_network(network)?; + let address = payjoin::bitcoin::Address::from_str(address.as_str())? + .require_network(network.into())?; payjoin::receive::v2::Receiver::new( address, directory, @@ -191,7 +191,7 @@ impl MaybeInputsSeen { ) -> Result { self.0 .clone() - .check_no_inputs_seen_before(|outpoint| Ok(is_known(outpoint)?)) + .check_no_inputs_seen_before(|outpoint| Ok(is_known(&(*outpoint).into())?)) .map_err(Into::into) .map(Into::into) } @@ -387,11 +387,11 @@ impl From for PayjoinProposal { impl PayjoinProposal { pub fn utxos_to_be_locked(&self) -> Vec { let mut outpoints: Vec = Vec::new(); - for e in + for o in >::into(self.clone()) .utxos_to_be_locked() { - outpoints.push(e.to_owned()); + outpoints.push((*o).into()); } outpoints } diff --git a/src/receive/uni.rs b/src/receive/uni.rs index 4e285df..2d6f742 100644 --- a/src/receive/uni.rs +++ b/src/receive/uni.rs @@ -199,7 +199,7 @@ impl MaybeInputsSeen { ) -> Result, PayjoinError> { self.0 .clone() - .check_no_inputs_seen_before(|outpoint| is_known.callback(*outpoint)) + .check_no_inputs_seen_before(|outpoint| is_known.callback(outpoint.clone())) .map(|t| Arc::new(t.into())) } }