Skip to content

Commit

Permalink
Depend on updated bitcoin-ffi w/ procmacros
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGould committed Jan 29, 2025
1 parent f3693b0 commit 33fc7f3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ uniffi = { version = "0.28.0", 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/dangould/bitcoin-ffi.git", rev = "57348c03cbff0d6e12ebd34bb3ad5015cccb4352" }
hex = "0.4.3"
ohttp = { package = "bitcoin-ohttp", version = "0.6.0" }
payjoin = { version = "0.22.0", features = ["send", "receive", "base64", "v2", "io"] }
Expand Down
6 changes: 0 additions & 6 deletions src/bitcoin_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
10 changes: 5 additions & 5 deletions src/receive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ impl Receiver {
ohttp_relay: Url,
expire_after: Option<u64>,
) -> Result<Self, PayjoinError> {
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())?;
Ok(payjoin::receive::v2::Receiver::new(
address,
directory.into(),
Expand Down Expand Up @@ -201,7 +201,7 @@ impl MaybeInputsSeen {
self.0
.clone()
.check_no_inputs_seen_before(|outpoint| {
is_known(outpoint).map_err(|e| pdk::Error::Server(Box::new(e)))
is_known(&(*outpoint).into()).map_err(|e| pdk::Error::Server(Box::new(e)))
})
.map_err(Into::into)
.map(Into::into)
Expand Down Expand Up @@ -406,11 +406,11 @@ impl From<payjoin::receive::v2::PayjoinProposal> for PayjoinProposal {
impl PayjoinProposal {
pub fn utxos_to_be_locked(&self) -> Vec<OutPoint> {
let mut outpoints: Vec<OutPoint> = Vec::new();
for e in
for o in
<PayjoinProposal as Into<payjoin::receive::v2::PayjoinProposal>>::into(self.clone())
.utxos_to_be_locked()
{
outpoints.push(e.to_owned());
outpoints.push((*o).into());
}
outpoints
}
Expand Down
2 changes: 1 addition & 1 deletion src/receive/uni.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl MaybeInputsSeen {
) -> Result<Arc<OutputsUnknown>, 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()))
}
}
Expand Down

0 comments on commit 33fc7f3

Please sign in to comment.