| 37 | } |
| 38 | |
| 39 | static struct secret secret_from_hex(const char *hex) |
| 40 | { |
| 41 | struct secret s; |
| 42 | size_t len; |
| 43 | if (strstarts(hex, "0x")) |
| 44 | hex += 2; |
| 45 | len = strlen(hex); |
| 46 | /* BOLT #3: |
| 47 | * |
| 48 | * - Private keys are displayed as 32 bytes plus a trailing 1 |
| 49 | * (Bitcoin's convention for "compressed" private keys, i.e. keys |
| 50 | * for which the public key is compressed). |
| 51 | */ |
| 52 | if (len == 66 && strends(hex, "01")) |
| 53 | len -= 2; |
| 54 | if (!hex_decode(hex, len, &s, sizeof(s))) |
| 55 | abort(); |
| 56 | return s; |
| 57 | } |
| 58 | |
| 59 | static void tx_must_be_eq(const struct bitcoin_tx *a, |
| 60 | const struct bitcoin_tx *b) |
no test coverage detected