Sort LSPS2 opening fee params menu according to spec requirements#3840
Conversation
|
👋 Thanks for assigning @tnull as a reviewer! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3840 +/- ##
==========================================
- Coverage 89.88% 89.83% -0.05%
==========================================
Files 162 162
Lines 130415 130422 +7
Branches 130415 130422 +7
==========================================
- Hits 117217 117165 -52
- Misses 10509 10552 +43
- Partials 2689 2705 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4f1609c to
16390e6
Compare
tnull
left a comment
There was a problem hiding this comment.
LGTM
Minor nit: please avoid rebasing on main if there are no conflicts, as it makes comparing the changes easier, especially if you force-push.
|
🔔 1st Reminder Hey @valentinewallace! This PR has been waiting for your review. |
|
🔔 2nd Reminder Hey @valentinewallace! This PR has been waiting for your review. |
|
🔔 3rd Reminder Hey @valentinewallace! This PR has been waiting for your review. |
valentinewallace
left a comment
There was a problem hiding this comment.
LGTM, test fails as expected on main
662cd77
into
lightningdevkit:main
Closes #3462
The LSPS2 specification requires that the
opening_fee_params_menuarray be sorted in a specific order to simplify fee display for clients, but the current implementation returns parameters in an arbitrary order.The LSPS2 spec:
This PR implements the sorting as described in the spec by sorting first by
min_fee_msat, then byproportionalfor equal values.The test creates an unsorted array of fee parameters and verifies that the returned menu follows all three ordering rules specified in the LSPS2 specification.