mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
common: implement route comparison in run-bolt11.
This next test will have route hints. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
4772025b5d
commit
7028493d01
1 changed files with 15 additions and 1 deletions
|
@ -117,8 +117,22 @@ static void test_b11(const char *b11str,
|
||||||
expect_b11->fallbacks[i],
|
expect_b11->fallbacks[i],
|
||||||
tal_count(expect_b11->fallbacks[i])));
|
tal_count(expect_b11->fallbacks[i])));
|
||||||
|
|
||||||
/* FIXME: compare routes. */
|
|
||||||
assert(tal_count(b11->routes) == tal_count(expect_b11->routes));
|
assert(tal_count(b11->routes) == tal_count(expect_b11->routes));
|
||||||
|
for (size_t i = 0; i < tal_count(b11->routes); i++) {
|
||||||
|
assert(tal_count(b11->routes[i])
|
||||||
|
== tal_count(expect_b11->routes[i]));
|
||||||
|
for (size_t j = 0; j < tal_count(b11->routes[i]); j++) {
|
||||||
|
const struct route_info *r = &b11->routes[i][j],
|
||||||
|
*er = &expect_b11->routes[i][j];
|
||||||
|
assert(node_id_eq(&er->pubkey, &r->pubkey));
|
||||||
|
assert(er->cltv_expiry_delta == r->cltv_expiry_delta);
|
||||||
|
assert(short_channel_id_eq(&er->short_channel_id,
|
||||||
|
&r->short_channel_id));
|
||||||
|
assert(er->fee_base_msat == r->fee_base_msat);
|
||||||
|
assert(er->fee_proportional_millionths
|
||||||
|
== r->fee_proportional_millionths);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
expect_extra = list_top(&expect_b11->extra_fields, struct bolt11_field,
|
expect_extra = list_top(&expect_b11->extra_fields, struct bolt11_field,
|
||||||
list);
|
list);
|
||||||
|
|
Loading…
Add table
Reference in a new issue