14 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
Adithya Vardhan
518641f5bb chore: add test for invalid destination 2023-02-25 20:42:32 +05:30
Adithya Vardhan
0b094e72cf fix: integration tests 2023-02-22 19:18:05 +05:30
kiwiidb
42e1451c22 add multikeysend test 2022-12-06 15:02:08 +01: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
9574b41a08 working on test refactoring 2022-06-15 11:39:54 +02:00
Stefan Kostic
2332e7a7d8 Add and use expected requests and responses for integration tests 2022-04-05 21:01:06 +02:00
Stefan Kostic
a5dfed3daf Fix keysend tests 2022-03-08 17:17:02 +01:00
Stefan Kostic
c6b4c3028c Remove todo and cleanup 2022-03-08 01:15:37 +01:00
Stefan Kostic
ba7c045729 Add keysend tests 2022-03-08 01:11:02 +01:00
kiwiidb
7c938477a6 make keysend work on regtest 2022-03-04 15:15:43 +01:00
kiwiidb
3d8ecd425f keysend: low-level work and instructions 2022-03-04 11:08:27 +01:00