Skip to content

Commit c7026e5

Browse files
committed
wallet: rename enum wallet_payment_status to payment_status.
We use it everywhere, the wallet_ prefix is weird. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 19669d8 commit c7026e5

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

lightningd/pay.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct sendpay_command {
3737
};
3838

3939
static bool string_to_payment_status(const char *status_str, size_t len,
40-
enum wallet_payment_status *status)
40+
enum payment_status *status)
4141
{
4242
if (memeqstr(status_str, len, "complete")) {
4343
*status = PAYMENT_COMPLETE;
@@ -52,7 +52,7 @@ static bool string_to_payment_status(const char *status_str, size_t len,
5252
return false;
5353
}
5454

55-
static const char *payment_status_to_string(const enum wallet_payment_status status)
55+
static const char *payment_status_to_string(const enum payment_status status)
5656
{
5757
switch (status) {
5858
case PAYMENT_COMPLETE:
@@ -1534,9 +1534,9 @@ static struct command_result *param_payment_status(struct command *cmd,
15341534
const char *name,
15351535
const char *buffer,
15361536
const jsmntok_t *tok,
1537-
enum wallet_payment_status **status)
1537+
enum payment_status **status)
15381538
{
1539-
*status = tal(cmd, enum wallet_payment_status);
1539+
*status = tal(cmd, enum payment_status);
15401540
if (string_to_payment_status(buffer + tok->start,
15411541
tok->end - tok->start,
15421542
*status))
@@ -1555,7 +1555,7 @@ static struct command_result *json_listsendpays(struct command *cmd,
15551555
struct json_stream *response;
15561556
struct sha256 *rhash;
15571557
const char *invstring;
1558-
enum wallet_payment_status *status;
1558+
enum payment_status *status;
15591559

15601560
if (!param(cmd, buffer, params,
15611561
/* FIXME: parameter should be invstring now */
@@ -1622,7 +1622,7 @@ param_payment_status_nopending(struct command *cmd,
16221622
const char *name,
16231623
const char *buffer,
16241624
const jsmntok_t *tok,
1625-
enum wallet_payment_status **status)
1625+
enum payment_status **status)
16261626
{
16271627
struct command_result *res;
16281628

@@ -1646,10 +1646,10 @@ static struct command_result *json_delpay(struct command *cmd,
16461646
const jsmntok_t *obj UNNEEDED,
16471647
const jsmntok_t *params)
16481648
{
1649-
const enum wallet_payment_status *found_status = NULL;
1649+
const enum payment_status *found_status = NULL;
16501650
struct json_stream *response;
16511651
const struct wallet_payment **payments;
1652-
enum wallet_payment_status *status;
1652+
enum payment_status *status;
16531653
struct sha256 *payment_hash;
16541654
u64 *groupid, *partid;
16551655
bool found;

wallet/wallet.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3352,7 +3352,7 @@ u64 wallet_payment_get_groupid(struct wallet *wallet,
33523352
void wallet_payment_delete(struct wallet *wallet,
33533353
const struct sha256 *payment_hash,
33543354
const u64 *groupid, const u64 *partid,
3355-
const enum wallet_payment_status *status)
3355+
const enum payment_status *status)
33563356
{
33573357
struct db_stmt *stmt;
33583358

@@ -3516,7 +3516,7 @@ wallet_payment_by_hash(const tal_t *ctx, struct wallet *wallet,
35163516
void wallet_payment_set_status(struct wallet *wallet,
35173517
const struct sha256 *payment_hash,
35183518
u64 partid, u64 groupid,
3519-
const enum wallet_payment_status newstatus,
3519+
const enum payment_status newstatus,
35203520
const struct preimage *preimage)
35213521
{
35223522
struct db_stmt *stmt;
@@ -3538,7 +3538,7 @@ void wallet_payment_set_status(struct wallet *wallet,
35383538
SQL("UPDATE payments SET status=?, completed_at=? "
35393539
"WHERE payment_hash=? AND partid=? AND groupid=?"));
35403540

3541-
db_bind_int(stmt, 0, wallet_payment_status_in_db(newstatus));
3541+
db_bind_int(stmt, 0, payment_status_in_db(newstatus));
35423542
if (completed_at != 0) {
35433543
db_bind_u64(stmt, 1, completed_at);
35443544
} else {

wallet/wallet.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,14 @@ struct wallet_shachain {
292292
struct shachain chain;
293293
};
294294

295-
/* Possible states for a wallet_payment. Payments start in
295+
/* Possible states for a payment. Payments start in
296296
* `PENDING`. Outgoing payments are set to `PAYMENT_COMPLETE` once we
297297
* get the preimage matching the rhash, or to
298298
* `PAYMENT_FAILED`. */
299299
/* /!\ This is a DB ENUM, please do not change the numbering of any
300300
* already defined elements (adding is ok but you should append the
301-
* test case test_wallet_payment_status_enum() ) /!\ */
302-
enum wallet_payment_status {
301+
* test case test_payment_status_enum() ) /!\ */
302+
enum payment_status {
303303
PAYMENT_PENDING = 0,
304304
PAYMENT_COMPLETE = 1,
305305
PAYMENT_FAILED = 2
@@ -310,7 +310,7 @@ struct tx_annotation {
310310
struct short_channel_id channel;
311311
};
312312

313-
static inline enum wallet_payment_status wallet_payment_status_in_db(enum wallet_payment_status w)
313+
static inline enum payment_status payment_status_in_db(enum payment_status w)
314314
{
315315
switch (w) {
316316
case PAYMENT_PENDING:
@@ -342,7 +342,7 @@ struct wallet_payment {
342342
u64 partid;
343343
u64 groupid;
344344

345-
enum wallet_payment_status status;
345+
enum payment_status status;
346346

347347
/* The destination may not be known if we used `sendonion` */
348348
struct node_id *destination;
@@ -1115,7 +1115,7 @@ void wallet_payment_store(struct wallet *wallet,
11151115
void wallet_payment_delete(struct wallet *wallet,
11161116
const struct sha256 *payment_hash,
11171117
const u64 *groupid, const u64 *partid,
1118-
const enum wallet_payment_status *status);
1118+
const enum payment_status *status);
11191119

11201120
/**
11211121
* wallet_local_htlc_out_delete - Remove a local outgoing failed HTLC
@@ -1157,7 +1157,7 @@ u64 wallet_payment_get_groupid(struct wallet *wallet,
11571157
void wallet_payment_set_status(struct wallet *wallet,
11581158
const struct sha256 *payment_hash,
11591159
u64 partid, u64 groupid,
1160-
const enum wallet_payment_status newstatus,
1160+
const enum payment_status newstatus,
11611161
const struct preimage *preimage);
11621162

11631163
/**

0 commit comments

Comments
 (0)