core-lightning/wallet/test
Mark Beckwith 7f437715d5 Added error code parameter to command_fail
Until now, `command_fail()` reported an error code of -1 for all uses.
This PR adds an `int code` parameter to `command_fail()`, requiring the
caller to explicitly include the error code.

This is part of #1464.

The majority of the calls are used during parameter validation and
their error code is now JSONRPC2_INVALID_PARAMS.

The rest of the calls report an error code of LIGHTNINGD, which I defined to
-1 in `jsonrpc_errors.h`.  The intention here is that as we improve our error
reporting, all occurenaces of LIGHTNINGD will go away and we can eventually
remove it.

I also converted calls to `command_fail_detailed()` that took a `NULL` `data`
parameter to use the new `command_fail()`.

The only difference from an end user perspecive is that bad input errors that
used to be -1 will now be -32602 (JSONRPC2_INVALID_PARAMS).
2018-05-26 12:17:36 +02:00
..
.gitignore wallet: move tests into test/ dir like other unit tests. 2017-12-13 22:46:10 +01:00
Makefile Initial TOR v2/v3 support. 2018-05-10 02:28:44 +00:00
run-db.c Force the use of the POSIX C locale for all commands and their subprocesses 2018-04-27 14:02:59 +02:00
run-wallet.c Added error code parameter to command_fail 2018-05-26 12:17:36 +02:00
test_utils.h Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00