Commit Graph

10 Commits

Author SHA1 Message Date
Michael Bumann
0de0ed18b4 Missing fix 2022-01-22 15:19:30 +01:00
Michael Bumann
319524ea4c Trying to get the PG constraints working
This uses row level locking on the accounts. If two transactions access the same account one fails
2022-01-22 13:00:46 +01:00
Michael Bumann
43aba70dd8 Fix invoice preimages for internal payments
We create the preimage on incoming invoices. If it is an internal incoming payment (meaning from one user to another user) we use that preimage and save it on the outgoing invoice.
This makes sure we can give wallets the correct preimage for a payment request even though no lightning transaction happened
2022-01-21 13:56:02 +01:00
Michael Bumann
a5d1c3f4ed Add constraint to invoices DB to make sure settled invoices have a preimage saved
We just try to store as much potential relevant information as possible.
This could help debugging and verifiying payments if there is an issue
2022-01-21 11:16:48 +01:00
Michael Bumann
3a67f86a34 Merge main 2022-01-20 14:15:40 +01:00
kiwiidb
7c51383feb replace all panics with log.Fatal 2022-01-20 13:44:59 +01:00
Michael Bumann
70a7e1a8eb Add DB constraints to check for user balances 2022-01-20 02:03:51 +01:00
Michael Bumann
b38357091d Add DB view for easier balance calculation and extend model associations 2022-01-19 10:57:50 +01:00
Viktor Patchev
919affa2db Update package name to new repo 2022-01-18 10:42:53 +01:00
Roman Useinov
628071160c Cleanup (#25)
* remove cmd folder as we are going to have only one entrypoint

* get rid of pkg directory

* rename test -> integration_tests as unit tests should reside next to the actual files they are testing

* database migration WIP

* reinstate gorm boilerplate in the addinvoice for now to make it compile

* introduce migrations

* add Makefile

* don't use unsigned types for database mappings

* migrations work now

* add build target

* use echo groups

* gorm removed

* add envconfig

* fix comments
2022-01-16 00:49:19 +01:00