type_to_string: support ripemd160.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-09-16 09:03:06 +09:30
parent e418f2a7fe
commit 86313383a7
2 changed files with 5 additions and 2 deletions

View file

@ -1,10 +1,13 @@
#include <ccan/crypto/ripemd160/ripemd160.h>
#include <ccan/crypto/sha256/sha256.h>
#include <ccan/tal/str/str.h>
#include <common/type_to_string.h>
#include <common/utils.h>
#include <inttypes.h>
/* We need at least one, and this is in CCAN so register it here. */
/* We need at least one, and these are in CCAN so register it here. */
REGISTER_TYPE_TO_HEXSTR(sha256);
REGISTER_TYPE_TO_HEXSTR(ripemd160);
char *type_to_string_(const tal_t *ctx, const char *typename,
union printable_types u)

View file

@ -3,7 +3,6 @@
#include "config.h"
#include "utils.h"
#include <ccan/autodata/autodata.h>
#include <ccan/crypto/sha256/sha256.h>
#include <secp256k1.h>
/* This must match the type_to_string_ cases. */
@ -11,6 +10,7 @@ union printable_types {
const struct pubkey *pubkey;
const struct sha256_double *sha256_double;
const struct sha256 *sha256;
const struct ripemd160 *ripemd160;
const struct rel_locktime *rel_locktime;
const struct abs_locktime *abs_locktime;
const struct bitcoin_tx *bitcoin_tx;