json: reverse parse a coin_mvt tag back into an enum

This commit is contained in:
niftynei
2022-02-16 15:36:47 -06:00
committed by Rusty Russell
parent 590f12145b
commit 7add7ca199
7 changed files with 28 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
#define LIGHTNING_COMMON_JSON_HELPERS_H
#include "config.h"
#include <bitcoin/tx.h>
#include <common/coin_mvt.h>
#include <common/json.h>
#include <wire/wire.h>
@@ -73,6 +74,10 @@ bool json_to_outpoint(const char *buffer, const jsmntok_t *tok,
bool json_to_channel_id(const char *buffer, const jsmntok_t *tok,
struct channel_id *cid);
/* Extract a coin movement 'tag' from this */
bool json_to_coin_mvt_tag(const char *buffer, const jsmntok_t *tok,
enum mvt_tag *tag);
/* Split a json token into 2 tokens given a splitting character */
bool split_tok(const char *buffer, const jsmntok_t *tok,
char split,