We fix up the test by using pay, instead of sendpay (and making pay log the expected message). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: sendpay no longer extracts updates from errors, the caller should do it from the `raw_message`.
6.5 KiB
6.5 KiB
| 1 | #include <common/cryptomsg.h> | ||||
|---|---|---|---|---|---|
| 2 | #include <common/features.h> | ||||
| 3 | #include <common/wireaddr.h> | ||||
| 4 | #include <wire/onion_wire.h> | ||||
| 5 | # Initialize the gossip daemon. | ||||
| 6 | msgtype | gossipd_init | 3000 | ||
| 7 | msgdata | gossipd_init | chainparams | chainparams | |
| 8 | msgdata | gossipd_init | our_features | feature_set | |
| 9 | msgdata | gossipd_init | id | node_id | |
| 10 | msgdata | gossipd_init | rgb | u8 | 3 |
| 11 | msgdata | gossipd_init | alias | u8 | 32 |
| 12 | msgdata | gossipd_init | num_announcable | u16 | |
| 13 | msgdata | gossipd_init | announcable | wireaddr | num_announcable |
| 14 | msgdata | gossipd_init | dev_gossip_time | ?u32 | |
| 15 | msgdata | gossipd_init | dev_fast_gossip | bool | |
| 16 | msgdata | gossipd_init | dev_fast_gossip_prune | bool | |
| 17 | # In developer mode | we can mess with time. | |||
| 18 | msgtype | gossipd_dev_set_time | 3001 | ||
| 19 | msgdata | gossipd_dev_set_time | dev_gossip_time | u32 | |
| 20 | # Pass JSON-RPC getnodes call through | ||||
| 21 | msgtype | gossipd_getnodes_request | 3005 | ||
| 22 | msgdata | gossipd_getnodes_request | id | ?node_id | |
| 23 | #include <lightningd/gossip_msg.h> | ||||
| 24 | msgtype | gossipd_getnodes_reply | 3105 | ||
| 25 | msgdata | gossipd_getnodes_reply | num_nodes | u32 | |
| 26 | msgdata | gossipd_getnodes_reply | nodes | gossip_getnodes_entry | num_nodes |
| 27 | # Pass JSON-RPC getroute call through | ||||
| 28 | msgtype | gossipd_getroute_request | 3006 | ||
| 29 | msgdata | gossipd_getroute_request | source | ?node_id | |
| 30 | msgdata | gossipd_getroute_request | destination | node_id | |
| 31 | msgdata | gossipd_getroute_request | msatoshi | amount_msat | |
| 32 | msgdata | gossipd_getroute_request | riskfactor_millionths | u64 | |
| 33 | msgdata | gossipd_getroute_request | final_cltv | u32 | |
| 34 | msgdata | gossipd_getroute_request | fuzz_millionths | u64 | |
| 35 | msgdata | gossipd_getroute_request | num_excluded | u16 | |
| 36 | msgdata | gossipd_getroute_request | excluded | exclude_entry | num_excluded |
| 37 | msgdata | gossipd_getroute_request | max_hops | u32 | |
| 38 | msgtype | gossipd_getroute_reply | 3106 | ||
| 39 | msgdata | gossipd_getroute_reply | num_hops | u16 | |
| 40 | msgdata | gossipd_getroute_reply | hops | route_hop | num_hops |
| 41 | msgtype | gossipd_getchannels_request | 3007 | ||
| 42 | msgdata | gossipd_getchannels_request | short_channel_id | ?short_channel_id | |
| 43 | msgdata | gossipd_getchannels_request | source | ?node_id | |
| 44 | msgdata | gossipd_getchannels_request | prev | ?short_channel_id | |
| 45 | msgtype | gossipd_getchannels_reply | 3107 | ||
| 46 | msgdata | gossipd_getchannels_reply | complete | bool | |
| 47 | msgdata | gossipd_getchannels_reply | num_channels | u32 | |
| 48 | msgdata | gossipd_getchannels_reply | nodes | gossip_getchannels_entry | num_channels |
| 49 | # Ping/pong test. Waits for a reply if it expects one. | ||||
| 50 | msgtype | gossipd_ping | 3008 | ||
| 51 | msgdata | gossipd_ping | id | node_id | |
| 52 | msgdata | gossipd_ping | num_pong_bytes | u16 | |
| 53 | msgdata | gossipd_ping | len | u16 | |
| 54 | msgtype | gossipd_ping_reply | 3108 | ||
| 55 | msgdata | gossipd_ping_reply | id | node_id | |
| 56 | # False if id in gossip_ping was unknown. | ||||
| 57 | msgdata | gossipd_ping_reply | sent | bool | |
| 58 | # 0 == no pong expected | ||||
| 59 | msgdata | gossipd_ping_reply | totlen | u16 | |
| 60 | # Set artificial maximum reply_channel_range size. Master->gossipd | ||||
| 61 | msgtype | gossipd_dev_set_max_scids_encode_size | 3030 | ||
| 62 | msgdata | gossipd_dev_set_max_scids_encode_size | max | u32 | |
| 63 | # Given a short_channel_id | return the latest (stripped) update for error msg. | |||
| 64 | msgtype | gossipd_get_stripped_cupdate | 3010 | ||
| 65 | msgdata | gossipd_get_stripped_cupdate | channel_id | short_channel_id | |
| 66 | msgtype | gossipd_get_stripped_cupdate_reply | 3110 | ||
| 67 | msgdata | gossipd_get_stripped_cupdate_reply | stripped_update_len | u16 | |
| 68 | msgdata | gossipd_get_stripped_cupdate_reply | stripped_update | u8 | stripped_update_len |
| 69 | # gossipd->master: we're closing this channel. | ||||
| 70 | msgtype | gossipd_local_channel_close | 3027 | ||
| 71 | msgdata | gossipd_local_channel_close | short_channel_id | short_channel_id | |
| 72 | # Gossipd->master get this tx output please. | ||||
| 73 | msgtype | gossipd_get_txout | 3018 | ||
| 74 | msgdata | gossipd_get_txout | short_channel_id | short_channel_id | |
| 75 | # master->gossipd here is the output | or empty if none. | |||
| 76 | msgtype | gossipd_get_txout_reply | 3118 | ||
| 77 | msgdata | gossipd_get_txout_reply | short_channel_id | short_channel_id | |
| 78 | msgdata | gossipd_get_txout_reply | satoshis | amount_sat | |
| 79 | msgdata | gossipd_get_txout_reply | len | u16 | |
| 80 | msgdata | gossipd_get_txout_reply | outscript | u8 | len |
| 81 | # master -> gossipd: a potential funding outpoint was spent | please forget the eventual channel | |||
| 82 | msgtype | gossipd_outpoint_spent | 3024 | ||
| 83 | msgdata | gossipd_outpoint_spent | short_channel_id | short_channel_id | |
| 84 | # master -> gossipd: stop gossip timers. | ||||
| 85 | msgtype | gossipd_dev_suppress | 3032 | ||
| 86 | # master -> gossipd: do you have a memleak? | ||||
| 87 | msgtype | gossipd_dev_memleak | 3033 | ||
| 88 | msgtype | gossipd_dev_memleak_reply | 3133 | ||
| 89 | msgdata | gossipd_dev_memleak_reply | leak | bool | |
| 90 | # master -> gossipd: please rewrite the gossip_store | ||||
| 91 | msgtype | gossipd_dev_compact_store | 3034 | ||
| 92 | # gossipd -> master: ok | ||||
| 93 | msgtype | gossipd_dev_compact_store_reply | 3134 | ||
| 94 | msgdata | gossipd_dev_compact_store_reply | success | bool | |
| 95 | #include <common/bolt11.h> | ||||
| 96 | # master -> gossipd: get route_info for our incoming channels | ||||
| 97 | msgtype | gossipd_get_incoming_channels | 3025 | ||
| 98 | # gossipd -> master: here they are. | ||||
| 99 | msgtype | gossipd_get_incoming_channels_reply | 3125 | ||
| 100 | msgdata | gossipd_get_incoming_channels_reply | num_public | u16 | |
| 101 | msgdata | gossipd_get_incoming_channels_reply | public_route_info | route_info | num_public |
| 102 | msgdata | gossipd_get_incoming_channels_reply | public_deadends | bool | num_public |
| 103 | msgdata | gossipd_get_incoming_channels_reply | num_private | u16 | |
| 104 | msgdata | gossipd_get_incoming_channels_reply | private_route_info | route_info | num_private |
| 105 | msgdata | gossipd_get_incoming_channels_reply | private_deadends | bool | num_private |
| 106 | # master -> gossipd: blockheight increased. | ||||
| 107 | msgtype | gossipd_new_blockheight | 3026 | ||
| 108 | msgdata | gossipd_new_blockheight | blockheight | u32 | |
| 109 | # Tell lightningd we got a onion message (for us | or to fwd) | |||
| 110 | msgtype | gossipd_got_onionmsg_to_us | 3142 | ||
| 111 | msgdata | gossipd_got_onionmsg_to_us | blinding_in | ?pubkey | |
| 112 | msgdata | gossipd_got_onionmsg_to_us | reply_blinding | ?pubkey | |
| 113 | msgdata | gossipd_got_onionmsg_to_us | reply_path_len | u16 | |
| 114 | msgdata | gossipd_got_onionmsg_to_us | reply_path | onionmsg_path | reply_path_len |
| 115 | msgdata | gossipd_got_onionmsg_to_us | rawmsg_len | u16 | |
| 116 | msgdata | gossipd_got_onionmsg_to_us | rawmsg | u8 | rawmsg_len |
| 117 | msgtype | gossipd_got_onionmsg_forward | 3143 | ||
| 118 | msgdata | gossipd_got_onionmsg_forward | next_scid | ?short_channel_id | |
| 119 | msgdata | gossipd_got_onionmsg_forward | next_node_id | ?node_id | |
| 120 | msgdata | gossipd_got_onionmsg_forward | next_blinding | ?pubkey | |
| 121 | msgdata | gossipd_got_onionmsg_forward | next_onion_len | u16 | |
| 122 | msgdata | gossipd_got_onionmsg_forward | next_onion | u8 | next_onion_len |
| 123 | # Lightningd tells us to send a onion message. | ||||
| 124 | msgtype | gossipd_send_onionmsg | 3040 | ||
| 125 | msgdata | gossipd_send_onionmsg | id | node_id | |
| 126 | msgdata | gossipd_send_onionmsg | onion_len | u16 | |
| 127 | msgdata | gossipd_send_onionmsg | onion | u8 | onion_len |
| 128 | msgdata | gossipd_send_onionmsg | blinding | ?pubkey | |
| 129 | # Lightningd tells us to inject a gossip message (for addgossip RPC) | ||||
| 130 | msgtype | gossipd_addgossip | 3044 | ||
| 131 | msgdata | gossipd_addgossip | len | u16 | |
| 132 | msgdata | gossipd_addgossip | msg | u8 | len |
| 133 | # Empty string means no problem. | ||||
| 134 | msgtype | gossipd_addgossip_reply | 3144 | ||
| 135 | msgdata | gossipd_addgossip_reply | err | wirestring |