| 58 | } |
| 59 | |
| 60 | static struct secret secret_from_hex(const char *hex) |
| 61 | { |
| 62 | struct secret s; |
| 63 | size_t len; |
| 64 | if (strstarts(hex, "0x")) |
| 65 | hex += 2; |
| 66 | len = strlen(hex); |
| 67 | /* BOLT #3: |
| 68 | * |
| 69 | * - Private keys are displayed as 32 bytes plus a trailing 1 |
| 70 | * (Bitcoin's convention for "compressed" private keys, i.e. keys |
| 71 | * for which the public key is compressed). |
| 72 | */ |
| 73 | if (len == 66 && strends(hex, "01")) |
| 74 | len -= 2; |
| 75 | if (!hex_decode(hex, len, &s, sizeof(s))) |
| 76 | abort(); |
| 77 | return s; |
| 78 | } |
| 79 | |
| 80 | static void tx_must_be_eq(const struct bitcoin_tx *a, |
| 81 | const struct bitcoin_tx *b) |
no test coverage detected