Commit Graph

28 Commits

Author SHA1 Message Date
Nadav Ivgi 3bbc5a593d Round invoice amounts up to nearest msatoshi
So that very small amounts are rounded to 1 msatoshi
rather than to 0.
2018-03-26 01:10:49 +03:00
Nadav Ivgi a27e283fa3 tests: Fix asserts 2018-03-26 00:41:43 +03:00
Nadav Ivgi a32edc0824 tests: Add unit test for GET /info 2018-03-03 05:18:56 +02:00
Nadav Ivgi e2402f039d test: allow to override DIR and NODE_ENV 2018-02-20 00:44:53 +02:00
Nadav Ivgi 41fc42a535 test prelude: use charged cli arguments interface 2018-01-31 05:26:06 +02:00
Nadav Ivgi 6c885c957c Docker: build speed & size optimizations
- Pre-build transpiled source code (babel/stylus) and remove the devDependencies build tools from the final image.

- Allow to optionally keep devDependencies by setting the build arg TESTRUNNER.

- Shuffle around to optimize for minimal cache invalidation and fast build times during development.
2018-01-31 05:20:28 +02:00
Nadav Ivgi 2e6b67406c More c-lightning log message changes
a98e8d9f44
689db5b7c1 (diff-bce87e89c6f89fd4fae9fffc01819758)
2018-01-29 18:55:31 +02:00
Nadav Ivgi a98e8d9f44 Update c-lightning startup log message string
As per changes in 689db5b7c1 (diff-bce87e89c6f89fd4fae9fffc01819758)
Refs: https://github.com/ElementsProject/lightning-charge/pull/21#issuecomment-361287388
2018-01-29 18:37:40 +02:00
Nadav Ivgi 2105c6f47b {test,docker}: Detect bitcoind startup more reliably
Instead of tailing the log file for the init message, wait for the `.cookie` file and use `-rpcwait`.

This results in faster startup times and is less prone to breaking with new bitcoind releases.
2018-01-27 16:30:25 +02:00
Nadav Ivgi f3f00de445 test: use bitcoind cookie-based authentication 2018-01-27 15:25:03 +02:00
Nadav Ivgi b6dc91cf99 Add "msatoshi_received" with the actual amount paid 2018-01-26 14:06:22 +02:00
Nadav Ivgi 5d3743acba Add support for invoices that accept any amount 2018-01-26 14:01:54 +02:00
Nadav Ivgi 5e05075e7f Separate server-sent-events to its own files 2018-01-20 23:40:55 +02:00
Nadav Ivgi 34a661df18 Add WebSocket server, resolves #13 2018-01-20 17:26:28 +02:00
Nadav Ivgi b44408d2fa test: Remove db migration from prelude
its already migrated automatically when starting the server
2018-01-20 15:02:52 +02:00
Nadav Ivgi 0327af234f Compatibility with c-lightning's latest API changes
- Use the new `status` argument for `delinvoice`, remove our manual status verification.

- Use the new `paid_at` field instead of using our local time when processing payments,
  rename our `completed_at` to match (but still expose `completed_at` for now).

- Read from the `expires_at` field (renamed from `expiry_time`, now matches our local field name).

- test: `getpeers` -> `listpeers`

- test: Remove use of addfunds.

- test: Set --allow-deprecated-apis=false by default, overridable with ALLOW_DEPRECATED.

- Remove the `completed` column and determine completion status based on the presence of `pay_index`,
  but still expose `completed` for now.
  Not entirely related to c-lightning's API changes, but tightly coupled with the other changes.

Refs: https://github.com/ElementsProject/lightning/pull/623
2018-01-20 15:02:52 +02:00
Nadav Ivgi 305724dc6a test: Increase default timeoutto 5s 2018-01-16 12:33:35 +02:00
Nadav Ivgi e45fce2d8b Server-Sent Events: Set Last-Event-ID to pay_index
And update tests to use a proper SourceEvent parser
2018-01-16 07:46:45 +02:00
Nadav Ivgi 8afedae89f test: Always enable debugging, keep stderr to log file 2018-01-16 07:01:21 +02:00
Nadav Ivgi 3c2c3edd55 Establish larger channel for test environment 2018-01-14 12:49:56 +02:00
Nadav Ivgi 5d2f74a77d Always show test environment directory 2018-01-14 12:49:56 +02:00
Nadav Ivgi 87cf0340b3 Add `status` field to invoices, as per upcoming changes in c-lightning.
Three possible states: `unpaid`, `paid` and `expired`.

The `completed` field is now deprecated as a public field
and will soon be hidden from the public APIs.

However, `completed` will continue to be used for internal storage,
with `status` as a virtual field determined based on `completed`, `expiry_time`
and the current time serving the request.
2018-01-14 12:49:56 +02:00
Nadav Ivgi b269b7b41b Pre-compile babel for npm publication 2018-01-09 00:04:22 +02:00
Nadav Ivgi e4e9a58389 Add "charged" CLI executable 2018-01-08 21:06:48 +02:00
Nadav Ivgi b549051f17 less verbosity when VERBOSE is not set 2018-01-08 19:03:58 +02:00
Nadav Ivgi aa794e0f0a Move scripts to scripts/ 2018-01-08 07:01:47 +02:00
Nadav Ivgi e01ff678e3 Add BITCOIND_OPTS to test prelude, normalize ARGS as OPTS 2018-01-08 05:20:53 +02:00
Nadav Ivgi 25e85d7109 Unit tests 2018-01-08 05:06:24 +02:00