| 86 | } |
| 87 | |
| 88 | static void add_in_out_with_serial(struct wally_psbt *psbt, |
| 89 | size_t serial_id, |
| 90 | size_t default_value) |
| 91 | { |
| 92 | struct bitcoin_outpoint outpoint; |
| 93 | u8 *script; |
| 94 | struct amount_sat sat; |
| 95 | struct wally_psbt_input *in; |
| 96 | struct wally_psbt_output *out; |
| 97 | |
| 98 | memset(&outpoint, default_value, sizeof(outpoint)); |
| 99 | in = psbt_append_input(psbt, &outpoint, default_value, |
| 100 | NULL, NULL, NULL); |
| 101 | if (!in) |
| 102 | abort(); |
| 103 | psbt_input_set_serial_id(psbt, in, serial_id); |
| 104 | |
| 105 | script = tal_arr(tmpctx, u8, 20); |
| 106 | memset(script, default_value, 20); |
| 107 | sat = amount_sat(default_value); |
| 108 | out = psbt_append_output(psbt, script, sat); |
| 109 | if (!out) |
| 110 | abort(); |
| 111 | psbt_output_set_serial_id(psbt, out, serial_id); |
| 112 | } |
| 113 | |
| 114 | /* Try changing up the serial ids */ |
| 115 | static void change_serials(void) |
no test coverage detected