Commit 7f1c797
committed
Support currency-denominated Offers in InvoiceBuilder
Adds currency conversion support when responding to an `InvoiceRequest`
and constructing the `InvoiceBuilder`.
When the underlying Offer specifies its amount in a currency denomination,
the `CurrencyConversion` implementation is used to resolve the payable
amount into millisatoshis and ensure the invoice amount satisfies the
Offer's requirements.
This reintroduces the currency validation intentionally skipped during
`InvoiceRequest` parsing, keeping parsing focused on structural
validation while enforcing amount correctness at the time the Invoice
is constructed.1 parent 36a8746 commit 7f1c797
6 files changed
Lines changed: 154 additions & 110 deletions
File tree
- lightning/src
- ln
- offers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5715 | 5715 | | |
5716 | 5716 | | |
5717 | 5717 | | |
| 5718 | + | |
5718 | 5719 | | |
5719 | 5720 | | |
5720 | 5721 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2367 | 2367 | | |
2368 | 2368 | | |
2369 | 2369 | | |
| 2370 | + | |
2370 | 2371 | | |
2371 | 2372 | | |
2372 | 2373 | | |
| |||
2401 | 2402 | | |
2402 | 2403 | | |
2403 | 2404 | | |
2404 | | - | |
| 2405 | + | |
2405 | 2406 | | |
2406 | 2407 | | |
2407 | 2408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
1230 | 1231 | | |
1231 | 1232 | | |
1232 | 1233 | | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
1236 | 1238 | | |
1237 | 1239 | | |
1238 | 1240 | | |
| |||
1280 | 1282 | | |
1281 | 1283 | | |
1282 | 1284 | | |
| 1285 | + | |
1283 | 1286 | | |
1284 | 1287 | | |
1285 | 1288 | | |
| |||
3311 | 3314 | | |
3312 | 3315 | | |
3313 | 3316 | | |
3314 | | - | |
| 3317 | + | |
3315 | 3318 | | |
3316 | 3319 | | |
3317 | 3320 | | |
| |||
3361 | 3364 | | |
3362 | 3365 | | |
3363 | 3366 | | |
3364 | | - | |
| 3367 | + | |
3365 | 3368 | | |
3366 | 3369 | | |
3367 | 3370 | | |
| |||
3427 | 3430 | | |
3428 | 3431 | | |
3429 | 3432 | | |
3430 | | - | |
| 3433 | + | |
3431 | 3434 | | |
3432 | 3435 | | |
3433 | 3436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
| 869 | + | |
873 | 870 | | |
874 | 871 | | |
875 | 872 | | |
| |||
998 | 995 | | |
999 | 996 | | |
1000 | 997 | | |
| 998 | + | |
1001 | 999 | | |
1002 | | - | |
1003 | | - | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
1004 | 1004 | | |
1005 | 1005 | | |
1006 | 1006 | | |
| |||
1021 | 1021 | | |
1022 | 1022 | | |
1023 | 1023 | | |
1024 | | - | |
| 1024 | + | |
1025 | 1025 | | |
1026 | 1026 | | |
| 1027 | + | |
1027 | 1028 | | |
1028 | 1029 | | |
1029 | 1030 | | |
| |||
1057 | 1058 | | |
1058 | 1059 | | |
1059 | 1060 | | |
| 1061 | + | |
1060 | 1062 | | |
1061 | | - | |
1062 | | - | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1063 | 1067 | | |
1064 | 1068 | | |
1065 | 1069 | | |
| |||
1080 | 1084 | | |
1081 | 1085 | | |
1082 | 1086 | | |
1083 | | - | |
| 1087 | + | |
1084 | 1088 | | |
1085 | 1089 | | |
| 1090 | + | |
1086 | 1091 | | |
1087 | 1092 | | |
1088 | 1093 | | |
| |||
0 commit comments