Skip to content

Commit a071022

Browse files
committed
Update extract_v2 signature in payjoin-ffi
The ohttp_relay parameter was changed from a Url to an IntoUrl trait in payjoin#692. Update the payjoin-ffi wrappers to reflect this.
1 parent 49f6670 commit a071022

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

payjoin-ffi/python/test/test_payjoin_integration_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async def test_integration_v2_to_v2(self):
107107
persister = InMemorySenderPersister()
108108
token = new_sender.persist(persister)
109109
req_ctx: Sender = Sender.load(token, persister)
110-
request: RequestV2PostContext = req_ctx.extract_v2(ohttp_relay)
110+
request: RequestV2PostContext = req_ctx.extract_v2(ohttp_relay.as_string())
111111
response = await agent.post(
112112
url=request.request.url.as_string(),
113113
headers={"Content-Type": request.request.content_type},

payjoin-ffi/src/send/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use payjoin::send::v2::SenderToken;
99
pub use crate::error::{ImplementationError, SerdeJsonError};
1010
use crate::ohttp::ClientResponse;
1111
use crate::request::Request;
12-
use crate::uri::{PjUri, Url};
12+
use crate::uri::PjUri;
1313

1414
pub mod error;
1515
#[cfg(feature = "uniffi")]
@@ -159,9 +159,9 @@ impl Sender {
159159
/// Extract serialized Request and Context from a Payjoin Proposal.
160160
pub fn extract_v2(
161161
&self,
162-
ohttp_relay: Url,
162+
ohttp_relay: String,
163163
) -> Result<(Request, V2PostContext), CreateRequestError> {
164-
match self.0.extract_v2(ohttp_relay.into()) {
164+
match self.0.extract_v2(ohttp_relay) {
165165
Ok((req, ctx)) => Ok((req.into(), ctx.into())),
166166
Err(e) => Err(e.into()),
167167
}

payjoin-ffi/src/send/uni.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::error::ForeignError;
44
pub use crate::send::{
55
BuildSenderError, CreateRequestError, EncapsulationError, ResponseError, SerdeJsonError,
66
};
7-
use crate::{ClientResponse, ImplementationError, PjUri, Request, Url};
7+
use crate::{ClientResponse, ImplementationError, PjUri, Request};
88

99
#[derive(uniffi::Object)]
1010
pub struct SenderBuilder(super::SenderBuilder);
@@ -151,9 +151,9 @@ impl Sender {
151151
/// and has no fallback to v1.
152152
pub fn extract_v2(
153153
&self,
154-
ohttp_proxy_url: Arc<Url>,
154+
ohttp_relay_url: String,
155155
) -> Result<RequestV2PostContext, CreateRequestError> {
156-
match self.0.extract_v2((*ohttp_proxy_url).clone()) {
156+
match self.0.extract_v2(ohttp_relay_url) {
157157
Ok((req, ctx)) => {
158158
Ok(RequestV2PostContext { request: req, context: Arc::new(ctx.into()) })
159159
}

0 commit comments

Comments
 (0)