-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store proofs used for paying a lightning invoice #311
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #311 +/- ##
==========================================
- Coverage 57.15% 56.83% -0.33%
==========================================
Files 43 43
Lines 4010 4110 +100
==========================================
+ Hits 2292 2336 +44
- Misses 1718 1774 +56
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry not a very useful review 😅 -- the msat
vs sat
'issue' is more general than this PR but seemed worth pointing out anyway
VALUES (?, ?, ?, ?, ?, ?, ?) | ||
""", | ||
( | ||
invoice.amount_msat / 1000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps worth the explicit 'cast' to an int to indicate that's what's going to happen DB-side anyway?
invoice.amount_msat / 1000, | |
int(invoice.amount_msat / 1000), |
""" | ||
await db.execute(f""" | ||
CREATE TABLE IF NOT EXISTS {table_with_schema(db, 'payments')} ( | ||
invoice_amount {db.big_int} NOT NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storing an amount as a big_int, but it is converted from msats
to sats
above with / 1000
, so any sub-sat amount is going to be truncated off... Probably OK, but a potential source of problems?
Closes #66.