mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
added a test case so that the enum wallet_payment_status which is critical for the communitcation with the data store will not accidentely being changed by some developer
[ Folded "cleaned up the test code" -- RR ] [ Fixed prototype -- RR ]
This commit is contained in:
parent
bd5bf1f168
commit
8b902729b9
@ -955,6 +955,14 @@ static bool test_payment_crud(struct lightningd *ld, const tal_t *ctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_wallet_payment_status_enum(void)
|
||||
{
|
||||
CHECK(PAYMENT_PENDING == 0);
|
||||
CHECK(PAYMENT_COMPLETE == 1);
|
||||
CHECK(PAYMENT_FAILED == 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
setup_locale();
|
||||
@ -979,6 +987,7 @@ int main(void)
|
||||
ok &= test_channel_config_crud(ld, tmpctx);
|
||||
ok &= test_htlc_crud(ld, tmpctx);
|
||||
ok &= test_payment_crud(ld, tmpctx);
|
||||
ok &= test_wallet_payment_status_enum();
|
||||
|
||||
/* Do not clean up in the case of an error, we might want to debug the
|
||||
* database. */
|
||||
|
@ -81,7 +81,8 @@ struct wallet_shachain {
|
||||
* get the preimage matching the rhash, or to
|
||||
* `PAYMENT_FAILED`. */
|
||||
/* /!\ This is a DB ENUM, please do not change the numbering of any
|
||||
* already defined elements (adding is ok) /!\ */
|
||||
* already defined elements (adding is ok but you should append the
|
||||
* test case test_wallet_payment_status_enum() ) /!\ */
|
||||
enum wallet_payment_status {
|
||||
PAYMENT_PENDING = 0,
|
||||
PAYMENT_COMPLETE = 1,
|
||||
|
Loading…
Reference in New Issue
Block a user