20399 Commits
Author SHA1 Message Date
ziggie 60026494b1 multi: thread context through InitPayment 2026-02-25 08:02:23 +01:00
ziggie 10062ca9ac multi: thread context through FetchInflightPayments 2026-02-25 08:02:23 +01:00
ziggie 25d05be038 multi: thread context through FetchPayment 2026-02-25 08:02:19 +01:00
ziggie 563a2ac9d3 multi: thread context through DeletePayments 2026-02-25 08:02:19 +01:00
ziggie bc15d4bb50 multi: thread context through DeletePayment 2026-02-25 08:02:19 +01:00
ziggie fcb8929ea5 docs: add release-notes 2026-02-25 08:02:19 +01:00
ziggie dfacb9ec00 paymentsdb: add unit test for FetchInflightPayments method 2026-02-25 08:02:18 +01:00
ziggie e40c8df16b paymentsdb: add firstcustom records to unit tests 2026-02-25 08:02:18 +01:00
ziggie bfd59aac22 paymentsdb: add more comments 2026-02-25 08:02:18 +01:00
ziggie ea4e183c39 lnrpc: fix linter 2026-02-25 08:02:18 +01:00
ziggie f518931cf0 itest: fix list_payments accuracy edge case 2026-02-25 08:02:18 +01:00
ziggie 5f1f413596 paymentsdb: make specific kv store tests only available via build tag 2026-02-25 08:02:18 +01:00
ziggie 080fd78fb4 paymentsdb: introduce a harness interface
The design of the sql and kv db are a bit different. A harness
interface is introduced which allows us to unit most of the test
and keep the backend specific tests at a minimum.
2026-02-25 08:02:17 +01:00
ziggie 570863ca26 paymentsdb: add harness to run payment db agnostic tests
In commit adds the harness which will be used to run db agnostic
tests against the kv and sql backend. We have adopted all the
unit tests so far so that with this commit all the payment tests
not specifically put into the kv_store_test.go should all pass
for all backends.
2026-02-25 08:02:17 +01:00
ziggie 2eadbfb54d paymentsdb: fix test case before testing sql backend
We are now not supporting the LegacyPayload for the onion packet
anymore. All payments and their onion payload need to be tlv
encoded. The sql backend assumes tlv so we have to always set the
in memory presentation of a hop where the legacy parameter is still
available but deprecated to false, otherwise the hops will not be
equal and unit tests for the sql backend will fail when switched
on in the next commits.
2026-02-25 08:02:17 +01:00
ziggie de50f471e8 paymentsdb: make QueryPayments test db agnostic
We make the QueryPayments test db agnostic and also keep a small
test for querying the duplicate payments case in the kv world.
2026-02-25 08:02:17 +01:00
ziggie fdfa1430f8 paymentsdb: refactor test helpers
Since now the sql backend is more strict in using the same
session key we refactor the helper so that we can easily change
the session key for every new attempt.
2026-02-25 08:02:17 +01:00
ziggie 9ad3f2195b paymentsdb: remove kvstore from sql db implementation
Now that every method of the interface was implemented we can
remove the embedded reference we put into place for the sql store
implementation so that the interface would succeed. This is now
removed.
2026-02-25 08:02:17 +01:00
ziggie c919d25619 docs: add release-notes 2026-02-25 08:02:16 +01:00
ziggie 4e52896cc1 paymentsdb: added unit test for computePaymentStatusFromResolutions 2026-02-25 08:02:16 +01:00
ziggie 969b00e4a5 paymentsdb: implement FetchInFlightPayments for sql backend 2026-02-25 08:02:16 +01:00
ziggie 82ee78c5ef paymentsdb: use batch function when querying for resolutions 2026-02-25 08:02:16 +01:00
ziggie b02531cc85 paymentsdb: rename functions and variables
We take inspiration from the graph sql implementation and name
the variables accordingly.
2026-02-25 08:02:16 +01:00
ziggie 218a30d16e paymentsdb: add a wrapper to the fetchpayment method
We wrap the fetchPayment db call and catch the case where no errors
are found in the db, where we now return the ErrPaymentNotInitiated
error.
2026-02-25 08:02:16 +01:00
ziggie ff12082452 paymentsdb: implement DeletePayments for sql backend 2026-02-25 08:02:16 +01:00
ziggie 53a7877af0 paymentsdb: implement FailAttempt for sql backend 2026-02-25 08:02:15 +01:00
ziggie fd6796e561 multi: implement Fail method for sql backend 2026-02-25 08:02:15 +01:00
ziggie caf73c59da paymentsdb: rename paymentsBatchData
We rename this variable to paymentsDetailsData because we will
also need to batch load the core payment and intent data in
future commits and this renaming should make it clear that this
does match payment related data but not the core data which is
in the payment and in the intent table.
2026-02-25 08:02:15 +01:00
ziggie 5d328c976e paymentsdb: remove pointer receiver dependecy to make it more robust
We remove the SQLStore from most of the helper functions. This
also makes sure we do not accidentally create a new db tx but use
the provided db SQLQueries parameter.
2026-02-25 08:02:15 +01:00
ziggie 7d87c0ce2f paymentsdb: fix formatting for sql QueryPayments 2026-02-25 08:02:15 +01:00
ziggie 4c867c1b88 docs: add release-notes 2026-02-25 08:02:15 +01:00
ziggie 620dacc432 paymentsdb: implement SettleAttempt for sql backend 2026-02-25 08:02:14 +01:00
ziggie c0e55b5855 paymentsdb: verify total amount for last hop in the blinded path 2026-02-25 08:02:14 +01:00
ziggie 40c8502fd3 paymentsdb: implement RegisterAttempt for sql backend 2026-02-25 08:02:14 +01:00
ziggie d2cdd9d86f paymentsdb: add note to RegisterAttempt 2026-02-25 08:02:14 +01:00
ziggie 510f6fb532 paymentsdb: implement InitPayment for sql backend 2026-02-25 08:02:09 +01:00
ziggie 0c96a2d722 sqldb+paymentsdb: add queries to insert all relavant data
In this commit we add all queries which we will need to insert
payment related data into the db.
2026-02-25 08:02:09 +01:00
ziggie c3e25ff8ef paymentsdb: implement DeletePayment for sql backend 2026-02-25 08:02:09 +01:00
ziggie 3012eb2ca0 paymentsdb: implement DeleteFailedAttempts for sql backend 2026-02-25 08:02:09 +01:00
ziggie 6faf68c5fa paymentsdb: add query to only fetch resolution type for HTLCs 2026-02-25 08:02:08 +01:00
ziggie bdea68bebf sqldb: add queries for deleting a payment and attempts 2026-02-25 08:02:08 +01:00
ziggie 27071acb6b sqldb: Change payment_intent relationship to payment table
Previously a one(intent)-to-many(payment) relationship it is now
changed to a one-to-one relationship because a payment request
only can have 1 payment related to it. Looking into the future
with BOLT12 offers, the fetched invoice from the offer could be
stored here as well and the relationship would still hold.
2026-02-25 08:02:08 +01:00
ziggie f8241748a1 paymentsdb: enhance some godoc function descriptions 2026-02-25 08:02:08 +01:00
ziggie 4c5eaad606 docs: add release-notes 2026-02-25 08:02:08 +01:00
ziggie 8aae9ffc2c paymentsdb: implement FetchPayment for sql backend 2026-02-25 08:02:08 +01:00
ziggie e8fe45fe65 paymentsdb: implement QueryPayments for sql backend 2026-02-25 08:02:08 +01:00
ziggie eeca189b87 paymentsdb: add new internal error 2026-02-25 08:02:07 +01:00
ziggie 18e7768837 multi: add relevant queries for QueryPayments implemenation 2026-02-25 08:02:04 +01:00
ziggie e7a3096621 sqldb: add index and comment to payment tables 2026-02-25 08:01:16 +01:00
ziggie b6a05f7951 docs: add release-notes 2026-02-25 08:01:15 +01:00