Skip to content

Commit a8a9e55

Browse files
committed
nostr: fix NIP-47 list_transactions response deserialization
Fixes #468 Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 2dcde03 commit a8a9e55

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838

3939
### Fixed
4040

41+
* nostr: fix NIP-47 `list_transactions` response deserialization ([Yuki Kishimoto])
42+
4143
### Removed
4244

4345
## [v0.32.0]

crates/nostr/src/nips/nip47.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,15 @@ impl Response {
723723
ResponseResult::LookupInvoice(result)
724724
}
725725
Method::ListTransactions => {
726-
let result: Vec<LookupInvoiceResponseResult> = serde_json::from_value(result)?;
726+
let transactions: Value =
727+
result
728+
.get("transactions")
729+
.cloned()
730+
.ok_or(Error::UnexpectedResult(String::from(
731+
"Missing 'transactions' field",
732+
)))?;
733+
let result: Vec<LookupInvoiceResponseResult> =
734+
serde_json::from_value(transactions)?;
727735
ResponseResult::ListTransactions(result)
728736
}
729737
Method::GetBalance => {

0 commit comments

Comments
 (0)