mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
utils: tal_hexstr() helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "bitcoin/tx.c"
|
||||
#include "bitcoin/shadouble.c"
|
||||
#include "bitcoin/varint.c"
|
||||
#include "utils.c"
|
||||
#include <assert.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
|
||||
@@ -8,8 +9,7 @@ const char extended_tx[] = "02000000000101b5bef485c41d0d1f58d1e8a561924ece5c476d
|
||||
|
||||
static void hexeq(const void *p, size_t len, const char *hex)
|
||||
{
|
||||
char *tmphex = tal_arr(NULL, char, hex_str_size(len));
|
||||
hex_encode(p, len, tmphex, tal_count(tmphex));
|
||||
char *tmphex = tal_hexstr(NULL, p, len);
|
||||
|
||||
if (strcmp(hex, tmphex)) {
|
||||
fprintf(stderr, "Expected '%s' got '%s'", hex, tmphex);
|
||||
|
||||
Reference in New Issue
Block a user