utils: add tal_hex() helper.

This is a shortcut when the data being dumped is a tal array.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-01-10 15:19:25 +10:30
parent 4a233090ae
commit 7b1a4fc765
8 changed files with 20 additions and 16 deletions

View File

@@ -10,6 +10,9 @@ extern secp256k1_context *secp256k1_ctx;
/* Allocate and fill in a hex-encoded string of this data. */
char *tal_hexstr(const tal_t *ctx, const void *data, size_t len);
/* Allocate and fill a hex-encoding of this tal pointer. */
char *tal_hex(const tal_t *ctx, const tal_t *data);
/* Allocate and fill a buffer with the data of this hex string. */
u8 *tal_hexdata(const tal_t *ctx, const void *str, size_t len);