26 Commits

Author SHA1 Message Date
Adithya Vardhan
badb700837 chore: allow 0 limits for send/receive amount/volume (#486)
* chore: allow 0 limits for send/receive amount/volume

* fix: use pointers for claims

* fix: tests to set default as -1

* chore: add 0 check in outgoing exceeded tests

* chore: also default max account balance to -1

* chore: remove dbUri :P

* chore: remove print statements

* chore: add more tests for limits
2024-04-05 09:21:08 +02:00
Michael Bumann
8deabc56be Add support for service fees (#474)
* Add support for service fees

This introduces a new transaction type "service_fee"
Each outgoing payment is charged a service fee of x/1000.
The service fee entries is added with the routing fee reserve entry.
For failed payments the service fee is reversed.

* Add service_fee migration

* No service fee by default

* Fee reserve and service fee is optional

ignore NoRows errors

* Update Makefile

* Unify setting the fee on the invoice

* Proper error check

* ups

* Add service fee tests to outgoing payment tests

* Save parant id to fee tx entries

* Optionally load test DB from env variable

* Add config for free transactions

payment amounts up to NO_SERVICE_FEE_UP_TO_AMOUNT don't get a service fee charged

* Update readme

* cleanup

* fix: only charge service fees for amounts > free limit

* fix: format

* Save service fee on invoice

* naming

* Also save the payment hash where we save the preimage

we already do exactly that when in the normal PayInvoice flow.
Normally the RHash is already set here, but I guess it does not hurt to have
it consistent everywhere.

* Use the invoice routing fee field to check if a routing fee must be charged

It feels a bit indirect to check if we have set a FeeReserve.
We save the routing fee on the invoice thus we should be able to use that information

* remove nullzero from fee columns

we want those to be 0 by default

* add columns only if not existent

---------

Co-authored-by: René Aaron <rene@twentyuno.net>
2024-01-13 14:07:11 +00:00
kiwiidb
ec0493c1b1 fix async payment test 2023-07-05 14:48:01 +02:00
kiwiidb
13fcf02182 too many / 2022-06-15 18:44:24 +02:00
kiwiidb
40e34086d7 all tests passing 2022-06-15 18:27:03 +02:00
kiwiidb
c9d7ddd9c7 one more file to refactor 2022-06-15 17:54:15 +02:00
kiwiidb
c680f77798 mock: add destination and proper signing 2022-06-15 16:12:04 +02:00
kiwiidb
9574b41a08 working on test refactoring 2022-06-15 11:39:54 +02:00
kiwiidb
f2acb462e2 fix test 2022-05-02 19:23:29 +02:00
kiwiidb
733ca4cf92 add 0 amount test 2022-05-02 19:12:31 +02:00
kiwiidb
e15e55c175 refactor tests 2022-05-02 19:10:39 +02:00
kiwiidb
37b603ed39 add test for gettxs fee field 2022-04-27 11:18:05 +02:00
Stefan Kostic
f13e8888bc Add test for negative balance 2022-03-04 18:32:35 +01:00
Stefan Kostic
9c81020829 Fix tests 2022-03-04 17:24:38 +01:00
Stefan Kostic
31cf4fbd13 Add transaction entries checks in outgoing payment test 2022-02-25 20:08:16 +01:00
Stefan Kostic
5033a33593 Add fee handling to tests 2022-02-25 19:40:46 +01:00
Stefan Kostic
e489320363 Change transaction entries count in existing tests 2022-02-25 19:21:16 +01:00
Stefan Kostic
6a32645b59 Add missing test 2022-02-18 12:39:24 +01:00
Stefan Kostic
09aee50ec0 Cleanup 2022-02-17 20:17:29 +01:00
Stefan Kostic
720a40061e Add and use lnd mock with failing send payment sync 2022-02-17 19:47:08 +01:00
kiwiidb
74da8f8088 new pr scope: don't bother with callbacks 2022-02-17 11:31:39 +01:00
kiwiidb
5c2d88d2f7 add desired integration test behaviour 2022-02-16 12:33:57 +01:00
Stefan Kostic
140ee03f7c Move payinvoice to test util method and use it on all places in tests 2022-02-11 11:45:05 +01:00
kiwiidb
aa0896a1ad replace TODO context with Background context for integration tests 2022-02-10 11:57:01 +01:00
kiwiidb
fcb2934060 pay external invoices 2022-02-07 12:21:06 +01:00
kiwiidb
6a1803ceb4 tests: add deposit integration test 2022-02-04 15:28:34 +01:00