Skip to content

Commit 12b4bab

Browse files
committed
Get endpoint by filtering on CreatedReplyKey event
The session endpoint can be pulled off an earlier event.
1 parent 30a58f7 commit 12b4bab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

payjoin/src/send/v2/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl<State: SenderState> core::ops::DerefMut for Sender<State> {
161161
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.state }
162162
}
163163

164-
#[derive(Debug, Clone)]
164+
#[derive(Debug, Clone, PartialEq, Eq)]
165165
pub enum SenderTypeState {
166166
Uninitialized(),
167167
WithReplyKey(Sender<WithReplyKey>),

payjoin/src/send/v2/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl SessionHistory {
7878

7979
pub fn endpoint(&self) -> Option<&Url> {
8080
self.events.iter().find_map(|event| match event {
81-
SessionEvent::V2GetContext(ctx) => Some(&ctx.endpoint),
81+
SessionEvent::CreatedReplyKey(proposal) => Some(&proposal.v1.endpoint),
8282
_ => None,
8383
})
8484
}

0 commit comments

Comments
 (0)