From 16f8b294b425f86d9b528b581c864b58e556aee6 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Wed, 3 Apr 2024 23:18:18 -0500 Subject: [PATCH] Fix for zap stuff --- Cargo.lock | 2 +- mutiny-core/src/hermes.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index feed4b40a..b9a74dff1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2618,7 +2618,7 @@ dependencies = [ [[package]] name = "mutiny-wasm" -version = "0.6.1" +version = "0.6.2-rc1" dependencies = [ "anyhow", "async-trait", diff --git a/mutiny-core/src/hermes.rs b/mutiny-core/src/hermes.rs index 550250e68..77ae4689a 100644 --- a/mutiny-core/src/hermes.rs +++ b/mutiny-core/src/hermes.rs @@ -16,7 +16,7 @@ use lightning::util::logger::Logger; use lightning::{log_error, log_info, log_warn}; use lightning_invoice::Bolt11Invoice; use nostr::prelude::decrypt_received_private_zap_message; -use nostr::{nips::nip04::decrypt, Event, Keys, Tag}; +use nostr::{nips::nip04::decrypt, Event, JsonUtil, Keys, Tag}; use nostr::{Filter, Kind, Timestamp}; use nostr_sdk::{Client, RelayPoolNotification}; use reqwest::Method; @@ -413,7 +413,7 @@ struct EcashNotification { pub federation_id: FederationId, /// The zap request that came along with this payment, /// useful for tagging the payment to a contact - pub zap_request: Option, + pub zap_request: Option, /// The bolt11 invoice for the payment pub bolt11: Bolt11Invoice, /// The preimage for the bolt11 invoice @@ -454,6 +454,7 @@ async fn handle_ecash_notification( let (privacy_level, msg, npub) = match notification.zap_request { None => (PrivacyLevel::NotAvailable, None, None), Some(zap_req) => { + let zap_req = Event::from_json(zap_req)?; // handle private/anon zaps let anon = zap_req.iter_tags().find_map(|tag| { if let Tag::Anon { msg } = tag {