common: Add some more JSON primitives

We were missing the `short_channel_id_dir` helpers.
This commit is contained in:
Christian Decker
2024-07-25 13:11:57 +02:00
committed by Rusty Russell
parent 8e9f71ff85
commit eae378c9d2
5 changed files with 40 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
#ifndef LIGHTNING_COMMON_JSON_PARSE_H
#define LIGHTNING_COMMON_JSON_PARSE_H
#include "config.h"
#include <bitcoin/short_channel_id.h>
#include <ccan/crypto/sha256/sha256.h>
#include <common/coin_mvt.h>
#include <common/errcode.h>
@@ -110,6 +111,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 channel id + dir from this */
bool json_to_short_channel_id_dir(const char *buffer, const jsmntok_t *tok,
struct short_channel_id_dir *scidd);
/* Extract a coin movement 'tag' from this */
bool json_to_coin_mvt_tag(const char *buffer, const jsmntok_t *tok,
enum mvt_tag *tag);