Commit Graph

17 Commits

Author SHA1 Message Date
Daniel D’Aquino
6f8e2d3064 Reintroduce invoice tests that have been previously disabled
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2026-02-02 16:10:09 -08:00
alltheseas
2c3fba5f90 Add test cases for invoices with longer HRP prefixes
Tests for gh-3456 MAX_PREFIX fix:
- lnbc100u (10,000 sats) - 7 char HRP baseline
- lnbc130130n (13,013 sats) - 11 char HRP, requires MAX_PREFIX > 10

Root cause: Invoices with "odd" sat amounts use nano-BTC encoding
which produces longer HRPs that exceeded old MAX_PREFIX limit.

Related: #3456

Signed-off-by: alltheseas <alltheseas@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:10:09 -08:00
alltheseas
1505a8f2e4 Simplify Swift invoice handling with non-optional return types
- Mentions.swift: convert_invoice_description now returns non-optional
  InvoiceDescription, returning empty description for BOLT11 compliance
  (both description and description_hash are optional per spec)

- Block.swift, NdbBlock.swift, NostrEvent.swift, NoteContent.swift:
  Updated call sites to use non-optional invoice conversion

- InvoiceTests.swift: Added test for specific failing invoice

Signed-off-by: alltheseas <alltheseas@noreply.github.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:10:09 -08:00
Daniel D’Aquino
05b62c5860 Fix edge case around bolt11 invoice parsing
Changelog-None
Closes: https://github.com/damus-io/damus/issues/3190
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-13 12:54:46 -07:00
Daniel D’Aquino
95a91bed7e Disable invoice block parsing tests
It was decided on a standup meeting that this feature is not important
and failing tests can be disabled.

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
f8245a7b0e Update Invoice tests to use the new blocks interface, and fix reverse blocks iteration indexing
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
William Casarin
690e1347e0 test: fix broken tests
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
c92094823e Add send feature
Closes: https://github.com/damus-io/damus/issues/2988
Changelog-Added: Added send feature to the wallet view
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-06-20 14:12:50 -07:00
Grimless
6ee0be40e9 Create helper extensions for Block and update tests for the Block helper model
Closes: https://github.com/damus-io/damus/pull/1528
Signed-off-by: William Casarin <jb55@jb55.com>
2023-09-03 18:02:32 -07:00
William Casarin
cebd1f48ca ndb: switch to nostrdb notes
This is a refactor of the codebase to use a more memory-efficient
representation of notes. It should also be much faster at decoding since
we're using a custom C json parser now.

Changelog-Changed: Improved memory usage and performance when processing events
2023-08-03 13:20:36 -07:00
William Casarin
0c95071de7 project: rename parse_mentions to parse_note_content
This is more accurate
2023-07-16 11:46:23 -07:00
William Casarin
374610a21a artifacts: allow unseparated note artifacts
This is needed for longform events. Right now we treat unseparated note
artifacts as a list of blocks, but we will likely need to render these
blocks into lists of attributed texts with image blocks inbetween.
2023-07-10 18:24:43 -07:00
William Casarin
5a956248f9 bolt11: fix bug where text not showing after invoice
Changelog-Fixed: Fix but where text was not showing after invoices
2023-01-01 11:31:36 -08:00
William Casarin
cf615b82b2 bolt11: fix any amount invoices 2023-01-01 11:02:44 -08:00
William Casarin
f351632440 bolt11: parse lightning prefixes on lightning invoice
Changelog-Fixed: Parse lightning prefixes on lightning invoice
2022-12-19 22:24:39 -08:00
William Casarin
9b7057de36 make url and invoice parsing case-insensitive
Signed-off-by: William Casarin <jb55@jb55.com>
2022-10-19 09:51:25 -07:00
William Casarin
c6ab1de639 Add bolt11 parser and Invoice View
Changelog-Added: Display bolt11 invoice widgets on posts
2022-10-19 07:46:05 -07:00