| 516 | static void remove_file(char *fname) { assert(!remove(fname)); } |
| 517 | |
| 518 | static void test_flow_to_route(void) |
| 519 | { |
| 520 | const double eps = 1e-8; |
| 521 | |
| 522 | const tal_t *this_ctx = tal(tmpctx, tal_t); |
| 523 | |
| 524 | char *gossfile; |
| 525 | int fd = tmpdir_mkstemp(this_ctx,"run-testflow.XXXXXX",&gossfile); |
| 526 | tal_add_destructor(gossfile, remove_file); |
| 527 | |
| 528 | assert(write_all(fd,canned_map,sizeof(canned_map))); |
| 529 | struct gossmap *gossmap = gossmap_load(this_ctx,gossfile,NULL,NULL); |
| 530 | assert(gossmap); |
| 531 | |
| 532 | // for(struct gossmap_node *node = gossmap_first_node(gossmap); |
| 533 | // node; |
| 534 | // node=gossmap_next_node(gossmap,node)) |
| 535 | // { |
| 536 | // struct node_id node_id; |
| 537 | // gossmap_node_get_id(gossmap,node,&node_id); |
| 538 | // const char *node_hex = node_id_to_hexstr(this_ctx,&node_id); |
| 539 | // printf("node: %s\n",node_hex); |
| 540 | // for(size_t i=0;i<node->num_chans;++i) |
| 541 | // { |
| 542 | // int half; |
| 543 | // const struct gossmap_chan *c = gossmap_nth_chan(gossmap,node,i,&half); |
| 544 | // if(!gossmap_chan_set(c,half)) |
| 545 | // continue; |
| 546 | // |
| 547 | // const struct short_channel_id scid = gossmap_chan_scid(gossmap,c); |
| 548 | // |
| 549 | // const char *scid_str = short_channel_id_to_str(this_ctx,&scid); |
| 550 | // |
| 551 | // printf(" scid: %s, half: %d\n",scid_str,half); |
| 552 | // } |
| 553 | // } |
| 554 | |
| 555 | struct node_id l1, l2, l3, l4, l5; |
| 556 | assert(node_id_from_hexstr("024f9da0d726adf0d9a4a3ac32e328b93ad527ccb9db7077c57a12c6f9fa9add74", 66, &l1)); |
| 557 | assert(node_id_from_hexstr("037f97af8e4fa67c9b8d6970849536f888c304316d015af5129e268e0164961b5e", 66, &l2)); |
| 558 | assert(node_id_from_hexstr("02451e9baff81faf5f410b0bbe9e36ee83bf8f79698e6605a51a9748bc73c7dc28", 66, &l3)); |
| 559 | assert(node_id_from_hexstr("02d1ab24fe53cfcac4a477745235c7ac3e75161a5bf8426ea8e0182ad58cab367f", 66, &l4)); |
| 560 | assert(node_id_from_hexstr("03caec54085508da06f14ffb836166ca22042d0fda69690356232a24b8366c8f85", 66, &l5)); |
| 561 | |
| 562 | struct short_channel_id scid12, scid23, scid34,scid45; |
| 563 | assert(short_channel_id_from_str("113x1x1", 7, &scid12)); |
| 564 | assert(short_channel_id_from_str("113x3x1", 7, &scid23)); |
| 565 | assert(short_channel_id_from_str("113x2x0", 7, &scid34)); |
| 566 | assert(short_channel_id_from_str("113x4x1", 7, &scid45)); |
| 567 | |
| 568 | struct chan_extra_map *chan_extra_map = tal(this_ctx, struct chan_extra_map); |
| 569 | chan_extra_map_init(chan_extra_map); |
| 570 | |
| 571 | struct chan_extra_half *h0,*h1; |
| 572 | struct gossmap_chan *c; |
| 573 | struct amount_msat cap; |
| 574 | struct amount_msat sum_min1_max0,sum_min0_max1; |
| 575 |
no test coverage detected