nwc: fix bug where private nwc zaps weren't getting tracked properly

It was using the wrapper zap request id instead of the inner id. Fix
this type error by creating a ZapRequestId wrapper that makes sure it
uses the proper request id.
This commit is contained in:
William Casarin
2023-05-14 10:48:44 -07:00
parent e472e559a5
commit b1fee253b4
6 changed files with 80 additions and 21 deletions

View File

@@ -45,7 +45,7 @@ let test_zap = Zap(event: test_event, invoice: test_zap_invoice, zapper: "zapper
let test_private_zap = Zap(event: test_event, invoice: test_zap_invoice, zapper: "zapper", target: .profile("pk"), request: test_zap_request, is_anon: false, private_request: test_event)
let test_pending_zap = PendingZap(amount_msat: 10000, target: .note(id: "id", author: "pk"), request: test_zap_request, type: .pub, state: .external(.init(state: .fetching_invoice)))
let test_pending_zap = PendingZap(amount_msat: 10000, target: .note(id: "id", author: "pk"), request: .normal(test_zap_request), type: .pub, state: .external(.init(state: .fetching_invoice)))
struct ZapEvent_Previews: PreviewProvider {
static var previews: some View {