diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index 035a5f20a..a17da5640 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -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. */ diff --git a/wallet/wallet.h b/wallet/wallet.h index 0e556ba06..fda903e3e 100644 --- a/wallet/wallet.h +++ b/wallet/wallet.h @@ -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,