Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit 88dd5cf

Browse files
Merge pull request #1106 from MutinyWallet/zap-fix
Fix for zap stuff
2 parents f3ec0cb + 16f8b29 commit 88dd5cf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mutiny-core/src/hermes.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use lightning::util::logger::Logger;
1616
use lightning::{log_error, log_info, log_warn};
1717
use lightning_invoice::Bolt11Invoice;
1818
use nostr::prelude::decrypt_received_private_zap_message;
19-
use nostr::{nips::nip04::decrypt, Event, Keys, Tag};
19+
use nostr::{nips::nip04::decrypt, Event, JsonUtil, Keys, Tag};
2020
use nostr::{Filter, Kind, Timestamp};
2121
use nostr_sdk::{Client, RelayPoolNotification};
2222
use reqwest::Method;
@@ -413,7 +413,7 @@ struct EcashNotification {
413413
pub federation_id: FederationId,
414414
/// The zap request that came along with this payment,
415415
/// useful for tagging the payment to a contact
416-
pub zap_request: Option<Event>,
416+
pub zap_request: Option<String>,
417417
/// The bolt11 invoice for the payment
418418
pub bolt11: Bolt11Invoice,
419419
/// The preimage for the bolt11 invoice
@@ -454,6 +454,7 @@ async fn handle_ecash_notification<S: MutinyStorage>(
454454
let (privacy_level, msg, npub) = match notification.zap_request {
455455
None => (PrivacyLevel::NotAvailable, None, None),
456456
Some(zap_req) => {
457+
let zap_req = Event::from_json(zap_req)?;
457458
// handle private/anon zaps
458459
let anon = zap_req.iter_tags().find_map(|tag| {
459460
if let Tag::Anon { msg } = tag {

0 commit comments

Comments
 (0)