2021-12-04 12:23:56 +01:00
|
|
|
#include "config.h"
|
2019-08-27 06:20:05 +02:00
|
|
|
int unused_main(int argc, char *argv[]);
|
|
|
|
#define main unused_main
|
2019-09-22 07:53:42 +02:00
|
|
|
#include "../queries.c"
|
2019-09-18 03:05:14 +02:00
|
|
|
#include "../gossip_generation.c"
|
2019-08-27 06:20:05 +02:00
|
|
|
#undef main
|
2021-11-30 04:06:05 +01:00
|
|
|
#include <common/blinding.h>
|
2021-09-09 04:50:52 +02:00
|
|
|
#include <common/channel_type.h>
|
2021-11-30 04:06:05 +01:00
|
|
|
#include <common/ecdh.h>
|
2020-02-27 03:17:01 +01:00
|
|
|
#include <common/json_stream.h>
|
2021-11-30 04:06:05 +01:00
|
|
|
#include <common/onionreply.h>
|
2021-11-14 18:52:46 +01:00
|
|
|
#include <common/setup.h>
|
2019-08-27 06:20:05 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
/* AUTOGENERATED MOCKS START */
|
2021-11-30 04:06:05 +01:00
|
|
|
/* Generated stub for blinding_hash_e_and_ss */
|
|
|
|
void blinding_hash_e_and_ss(const struct pubkey *e UNNEEDED,
|
|
|
|
const struct secret *ss UNNEEDED,
|
|
|
|
struct sha256 *sha UNNEEDED)
|
|
|
|
{ fprintf(stderr, "blinding_hash_e_and_ss called!\n"); abort(); }
|
|
|
|
/* Generated stub for blinding_next_privkey */
|
|
|
|
bool blinding_next_privkey(const struct privkey *e UNNEEDED,
|
|
|
|
const struct sha256 *h UNNEEDED,
|
|
|
|
struct privkey *next UNNEEDED)
|
|
|
|
{ fprintf(stderr, "blinding_next_privkey called!\n"); abort(); }
|
|
|
|
/* Generated stub for blinding_next_pubkey */
|
|
|
|
bool blinding_next_pubkey(const struct pubkey *pk UNNEEDED,
|
|
|
|
const struct sha256 *h UNNEEDED,
|
|
|
|
struct pubkey *next UNNEEDED)
|
|
|
|
{ fprintf(stderr, "blinding_next_pubkey called!\n"); abort(); }
|
2022-01-24 20:59:52 +01:00
|
|
|
/* Generated stub for daemon_conn_send */
|
|
|
|
void daemon_conn_send(struct daemon_conn *dc UNNEEDED, const u8 *msg UNNEEDED)
|
|
|
|
{ fprintf(stderr, "daemon_conn_send called!\n"); abort(); }
|
2019-08-27 06:20:05 +02:00
|
|
|
/* Generated stub for daemon_conn_wake */
|
|
|
|
void daemon_conn_wake(struct daemon_conn *dc UNNEEDED)
|
|
|
|
{ fprintf(stderr, "daemon_conn_wake called!\n"); abort(); }
|
2019-10-08 03:23:24 +02:00
|
|
|
/* Generated stub for decode_channel_update_timestamps */
|
|
|
|
struct channel_update_timestamps *decode_channel_update_timestamps(const tal_t *ctx UNNEEDED,
|
|
|
|
const struct tlv_reply_channel_range_tlvs_timestamps_tlv *timestamps_tlv UNNEEDED)
|
|
|
|
{ fprintf(stderr, "decode_channel_update_timestamps called!\n"); abort(); }
|
2019-09-20 08:58:51 +02:00
|
|
|
/* Generated stub for decode_scid_query_flags */
|
|
|
|
bigsize_t *decode_scid_query_flags(const tal_t *ctx UNNEEDED,
|
|
|
|
const struct tlv_query_short_channel_ids_tlvs_query_flags *qf UNNEEDED)
|
|
|
|
{ fprintf(stderr, "decode_scid_query_flags called!\n"); abort(); }
|
2019-08-27 06:20:05 +02:00
|
|
|
/* Generated stub for decode_short_ids */
|
|
|
|
struct short_channel_id *decode_short_ids(const tal_t *ctx UNNEEDED, const u8 *encoded UNNEEDED)
|
|
|
|
{ fprintf(stderr, "decode_short_ids called!\n"); abort(); }
|
2021-11-30 04:06:05 +01:00
|
|
|
/* Generated stub for ecdh */
|
|
|
|
void ecdh(const struct pubkey *point UNNEEDED, struct secret *ss UNNEEDED)
|
|
|
|
{ fprintf(stderr, "ecdh called!\n"); abort(); }
|
2019-09-22 07:53:42 +02:00
|
|
|
/* Generated stub for find_peer */
|
|
|
|
struct peer *find_peer(struct daemon *daemon UNNEEDED, const struct node_id *id UNNEEDED)
|
|
|
|
{ fprintf(stderr, "find_peer called!\n"); abort(); }
|
2020-08-25 04:05:45 +02:00
|
|
|
/* Generated stub for fromwire_gossipd_dev_set_max_scids_encode_size */
|
|
|
|
bool fromwire_gossipd_dev_set_max_scids_encode_size(const void *p UNNEEDED, u32 *max UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_gossipd_dev_set_max_scids_encode_size called!\n"); abort(); }
|
2019-09-16 12:44:00 +02:00
|
|
|
/* Generated stub for fromwire_gossipd_local_channel_update */
|
2022-01-24 21:03:52 +01:00
|
|
|
bool fromwire_gossipd_local_channel_update(const void *p UNNEEDED, struct node_id *id UNNEEDED, struct short_channel_id *short_channel_id UNNEEDED, bool *disable UNNEEDED, u16 *cltv_expiry_delta UNNEEDED, struct amount_msat *htlc_minimum_msat UNNEEDED, u32 *fee_base_msat UNNEEDED, u32 *fee_proportional_millionths UNNEEDED, struct amount_msat *htlc_maximum_msat UNNEEDED)
|
2019-09-16 12:44:00 +02:00
|
|
|
{ fprintf(stderr, "fromwire_gossipd_local_channel_update called!\n"); abort(); }
|
2022-01-24 21:00:52 +01:00
|
|
|
/* Generated stub for fromwire_gossipd_used_local_channel_update */
|
|
|
|
bool fromwire_gossipd_used_local_channel_update(const void *p UNNEEDED, struct short_channel_id *scid UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_gossipd_used_local_channel_update called!\n"); abort(); }
|
2020-08-25 03:55:38 +02:00
|
|
|
/* Generated stub for fromwire_hsmd_cupdate_sig_reply */
|
|
|
|
bool fromwire_hsmd_cupdate_sig_reply(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u8 **cu UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_hsmd_cupdate_sig_reply called!\n"); abort(); }
|
|
|
|
/* Generated stub for fromwire_hsmd_node_announcement_sig_reply */
|
|
|
|
bool fromwire_hsmd_node_announcement_sig_reply(const void *p UNNEEDED, secp256k1_ecdsa_signature *signature UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_hsmd_node_announcement_sig_reply called!\n"); abort(); }
|
2019-08-27 06:20:05 +02:00
|
|
|
/* Generated stub for get_node */
|
|
|
|
struct node *get_node(struct routing_state *rstate UNNEEDED,
|
|
|
|
const struct node_id *id UNNEEDED)
|
|
|
|
{ fprintf(stderr, "get_node called!\n"); abort(); }
|
|
|
|
/* Generated stub for gossip_store_get */
|
|
|
|
const u8 *gossip_store_get(const tal_t *ctx UNNEEDED,
|
|
|
|
struct gossip_store *gs UNNEEDED,
|
|
|
|
u64 offset UNNEEDED)
|
|
|
|
{ fprintf(stderr, "gossip_store_get called!\n"); abort(); }
|
2019-09-12 02:22:12 +02:00
|
|
|
/* Generated stub for gossip_time_now */
|
|
|
|
struct timeabs gossip_time_now(const struct routing_state *rstate UNNEEDED)
|
|
|
|
{ fprintf(stderr, "gossip_time_now called!\n"); abort(); }
|
2019-08-27 06:20:05 +02:00
|
|
|
/* Generated stub for handle_channel_update */
|
|
|
|
u8 *handle_channel_update(struct routing_state *rstate UNNEEDED, const u8 *update TAKES UNNEEDED,
|
2019-10-08 03:13:24 +02:00
|
|
|
struct peer *peer UNNEEDED,
|
2021-01-29 01:00:09 +01:00
|
|
|
struct short_channel_id *unknown_scid UNNEEDED,
|
|
|
|
bool force UNNEEDED)
|
2019-08-27 06:20:05 +02:00
|
|
|
{ fprintf(stderr, "handle_channel_update called!\n"); abort(); }
|
|
|
|
/* Generated stub for handle_node_announcement */
|
2019-10-08 03:13:24 +02:00
|
|
|
u8 *handle_node_announcement(struct routing_state *rstate UNNEEDED, const u8 *node UNNEEDED,
|
2019-10-08 03:32:24 +02:00
|
|
|
struct peer *peer UNNEEDED, bool *was_unknown UNNEEDED)
|
2019-08-27 06:20:05 +02:00
|
|
|
{ fprintf(stderr, "handle_node_announcement called!\n"); abort(); }
|
|
|
|
/* Generated stub for master_badmsg */
|
|
|
|
void master_badmsg(u32 type_expected UNNEEDED, const u8 *msg)
|
|
|
|
{ fprintf(stderr, "master_badmsg called!\n"); abort(); }
|
2021-11-30 04:06:05 +01:00
|
|
|
/* Generated stub for new_onionreply */
|
|
|
|
struct onionreply *new_onionreply(const tal_t *ctx UNNEEDED, const u8 *contents TAKES UNNEEDED)
|
|
|
|
{ fprintf(stderr, "new_onionreply called!\n"); abort(); }
|
2019-08-27 06:20:05 +02:00
|
|
|
/* Generated stub for new_reltimer_ */
|
|
|
|
struct oneshot *new_reltimer_(struct timers *timers UNNEEDED,
|
|
|
|
const tal_t *ctx UNNEEDED,
|
|
|
|
struct timerel expire UNNEEDED,
|
|
|
|
void (*cb)(void *) UNNEEDED, void *arg UNNEEDED)
|
|
|
|
{ fprintf(stderr, "new_reltimer_ called!\n"); abort(); }
|
2019-10-08 03:26:24 +02:00
|
|
|
/* Generated stub for peer_supplied_good_gossip */
|
|
|
|
void peer_supplied_good_gossip(struct peer *peer UNNEEDED, size_t amount UNNEEDED)
|
|
|
|
{ fprintf(stderr, "peer_supplied_good_gossip called!\n"); abort(); }
|
2019-09-22 07:53:42 +02:00
|
|
|
/* Generated stub for queue_peer_from_store */
|
|
|
|
void queue_peer_from_store(struct peer *peer UNNEEDED,
|
|
|
|
const struct broadcastable *bcast UNNEEDED)
|
|
|
|
{ fprintf(stderr, "queue_peer_from_store called!\n"); abort(); }
|
|
|
|
/* Generated stub for queue_peer_msg */
|
|
|
|
void queue_peer_msg(struct peer *peer UNNEEDED, const u8 *msg TAKES UNNEEDED)
|
|
|
|
{ fprintf(stderr, "queue_peer_msg called!\n"); abort(); }
|
2019-08-27 06:20:05 +02:00
|
|
|
/* Generated stub for status_failed */
|
|
|
|
void status_failed(enum status_failreason code UNNEEDED,
|
|
|
|
const char *fmt UNNEEDED, ...)
|
|
|
|
{ fprintf(stderr, "status_failed called!\n"); abort(); }
|
|
|
|
/* Generated stub for status_fmt */
|
2019-11-17 12:42:33 +01:00
|
|
|
void status_fmt(enum log_level level UNNEEDED,
|
|
|
|
const struct node_id *peer UNNEEDED,
|
|
|
|
const char *fmt UNNEEDED, ...)
|
2019-08-27 06:20:05 +02:00
|
|
|
|
|
|
|
{ fprintf(stderr, "status_fmt called!\n"); abort(); }
|
2022-01-24 20:59:52 +01:00
|
|
|
/* Generated stub for towire_gossipd_got_local_channel_update */
|
|
|
|
u8 *towire_gossipd_got_local_channel_update(const tal_t *ctx UNNEEDED, const struct short_channel_id *scid UNNEEDED, const u8 *channel_update UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_gossipd_got_local_channel_update called!\n"); abort(); }
|
2020-08-25 03:55:38 +02:00
|
|
|
/* Generated stub for towire_hsmd_cupdate_sig_req */
|
|
|
|
u8 *towire_hsmd_cupdate_sig_req(const tal_t *ctx UNNEEDED, const u8 *cu UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_hsmd_cupdate_sig_req called!\n"); abort(); }
|
|
|
|
/* Generated stub for towire_hsmd_node_announcement_sig_req */
|
|
|
|
u8 *towire_hsmd_node_announcement_sig_req(const tal_t *ctx UNNEEDED, const u8 *announcement UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_hsmd_node_announcement_sig_req called!\n"); abort(); }
|
2021-02-03 03:51:41 +01:00
|
|
|
/* Generated stub for towire_warningfmt */
|
|
|
|
u8 *towire_warningfmt(const tal_t *ctx UNNEEDED,
|
|
|
|
const struct channel_id *channel UNNEEDED,
|
|
|
|
const char *fmt UNNEEDED, ...)
|
|
|
|
{ fprintf(stderr, "towire_warningfmt called!\n"); abort(); }
|
2019-09-16 12:44:00 +02:00
|
|
|
/* Generated stub for wire_sync_read */
|
|
|
|
u8 *wire_sync_read(const tal_t *ctx UNNEEDED, int fd UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wire_sync_read called!\n"); abort(); }
|
|
|
|
/* Generated stub for wire_sync_write */
|
|
|
|
bool wire_sync_write(int fd UNNEEDED, const void *msg TAKES UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wire_sync_write called!\n"); abort(); }
|
2019-08-27 06:20:05 +02:00
|
|
|
/* AUTOGENERATED MOCKS END */
|
|
|
|
|
2020-12-02 01:10:04 +01:00
|
|
|
int main(int argc, char *argv[])
|
2019-08-27 06:20:05 +02:00
|
|
|
{
|
|
|
|
u8 *update;
|
2021-11-14 18:52:46 +01:00
|
|
|
common_setup(argv[0]);
|
2019-08-27 06:20:05 +02:00
|
|
|
|
|
|
|
update = tal_hexdata(NULL, "010276df7e70c63cc2b63ef1c062b99c6d934a80ef2fd4dae9e1d86d277f47674af3255a97fa52ade7f129263f591ed784996eba6383135896cc117a438c8029328206226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f00006700000100005d50f933000000900000000000000000000003e80000000a",
|
|
|
|
strlen("010276df7e70c63cc2b63ef1c062b99c6d934a80ef2fd4dae9e1d86d277f47674af3255a97fa52ade7f129263f591ed784996eba6383135896cc117a438c8029328206226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f00006700000100005d50f933000000900000000000000000000003e80000000a"));
|
|
|
|
assert(crc32_of_update(update) == 0x1112fa30);
|
|
|
|
tal_free(update);
|
|
|
|
|
|
|
|
update = tal_hexdata(NULL, "010206737e9e18d3e4d0ab4066ccaecdcc10e648c5f1c5413f1610747e0d463fa7fa39c1b02ea2fd694275ecfefe4fe9631f24afd182ab75b805e16cd550941f858c06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f00006d00000100005d50f935010000300000000000000000000000640000000b00000000000186a0",
|
|
|
|
strlen("010206737e9e18d3e4d0ab4066ccaecdcc10e648c5f1c5413f1610747e0d463fa7fa39c1b02ea2fd694275ecfefe4fe9631f24afd182ab75b805e16cd550941f858c06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f00006d00000100005d50f935010000300000000000000000000000640000000b00000000000186a0"));
|
|
|
|
assert(crc32_of_update(update) == 0xf32ce968);
|
|
|
|
tal_free(update);
|
2021-11-14 18:52:46 +01:00
|
|
|
common_shutdown();
|
2019-08-27 06:20:05 +02:00
|
|
|
return 0;
|
|
|
|
}
|