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
14 changes: 7 additions & 7 deletions payjoin-ffi/src/send/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ impl InitInputsTransition {
///
///These parameters define how client wants to handle Payjoin.
#[derive(Clone)]
pub struct SenderBuilder(payjoin::send::v2::SenderBuilder<'static>);
pub struct SenderBuilder(payjoin::send::v2::SenderBuilder);

impl From<payjoin::send::v2::SenderBuilder<'static>> for SenderBuilder {
fn from(value: payjoin::send::v2::SenderBuilder<'static>) -> Self { Self(value) }
impl From<payjoin::send::v2::SenderBuilder> for SenderBuilder {
fn from(value: payjoin::send::v2::SenderBuilder) -> Self { Self(value) }
}

impl SenderBuilder {
Expand Down Expand Up @@ -259,16 +259,16 @@ impl WithReplyKey {
/// Data required for validation of response.
/// This type is used to process the response. Get it from SenderBuilder's build methods. Then you only need to call .process_response() on it to continue BIP78 flow.
#[derive(Clone)]
pub struct V1Context(Arc<payjoin::send::v1::V1Context>);
impl From<payjoin::send::v1::V1Context> for V1Context {
fn from(value: payjoin::send::v1::V1Context) -> Self { Self(Arc::new(value)) }
pub struct V1Context(Arc<payjoin::send::V1Context>);
impl From<payjoin::send::V1Context> for V1Context {
fn from(value: payjoin::send::V1Context) -> Self { Self(Arc::new(value)) }
}

impl V1Context {
///Decodes and validates the response.
/// Call this method with response from receiver to continue BIP78 flow. If the response is valid you will get appropriate PSBT that you should sign and broadcast.
pub fn process_response(&self, response: &[u8]) -> Result<String, ResponseError> {
<payjoin::send::v1::V1Context as Clone>::clone(&self.0.clone())
<payjoin::send::V1Context as Clone>::clone(&self.0.clone())
.process_response(response)
.map(|e| e.to_string())
.map_err(Into::into)
Expand Down
13 changes: 0 additions & 13 deletions payjoin/src/core/output_substitution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,3 @@ pub enum OutputSubstitution {
Enabled,
Disabled,
}

impl OutputSubstitution {
/// Combine two output substitution flags.
///
/// If both are enabled, the result is enabled.
/// If one is disabled, the result is disabled.
pub(crate) fn combine(self, other: Self) -> Self {
match (self, other) {
(Self::Enabled, Self::Enabled) => Self::Enabled,
_ => Self::Disabled,
}
}
}
Loading
Loading