| 238 | }; |
| 239 | |
| 240 | static void check_cannounce(const u8 *cannounce, |
| 241 | const struct short_channel_id *scid, |
| 242 | const struct node_id *n1, |
| 243 | const struct node_id *n2) |
| 244 | { |
| 245 | secp256k1_ecdsa_signature sig; |
| 246 | u8 *features; |
| 247 | struct bitcoin_blkid chain_hash; |
| 248 | struct short_channel_id actual_scid; |
| 249 | struct node_id actual_n1, actual_n2; |
| 250 | struct pubkey k; |
| 251 | |
| 252 | assert(fromwire_channel_announcement(cannounce, cannounce, |
| 253 | &sig, &sig, &sig, &sig, |
| 254 | &features, &chain_hash, |
| 255 | &actual_scid, |
| 256 | &actual_n1, |
| 257 | &actual_n2, |
| 258 | &k, &k)); |
| 259 | assert(short_channel_id_eq(&actual_scid, scid)); |
| 260 | if (node_id_cmp(n1, n2) < 0) { |
| 261 | assert(node_id_eq(&actual_n1, n1)); |
| 262 | assert(node_id_eq(&actual_n2, n2)); |
| 263 | } else { |
| 264 | assert(node_id_eq(&actual_n1, n2)); |
| 265 | assert(node_id_eq(&actual_n2, n1)); |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | static void check_nannounce(const u8 *nannounce, |
| 270 | const struct node_id *n) |
no test coverage detected