mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 07:34:21 +01:00
wire: move remaining bitcoin functions out to bitcoin/ files.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
197d1bcef2
commit
cfb320c972
@@ -1,4 +1,6 @@
|
||||
#include <assert.h>
|
||||
#include <common/bigsize.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
#ifndef SUPERVERBOSE
|
||||
#define SUPERVERBOSE(...)
|
||||
@@ -97,3 +99,26 @@ size_t bigsize_get(const u8 *p, size_t max, bigsize_t *val)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
bigsize_t fromwire_bigsize(const u8 **cursor, size_t *max)
|
||||
{
|
||||
bigsize_t v;
|
||||
size_t len = bigsize_get(*cursor, *max, &v);
|
||||
|
||||
if (len == 0) {
|
||||
fromwire_fail(cursor, max);
|
||||
return 0;
|
||||
}
|
||||
assert(len <= *max);
|
||||
fromwire(cursor, max, NULL, len);
|
||||
return v;
|
||||
}
|
||||
|
||||
void towire_bigsize(u8 **pptr, const bigsize_t val)
|
||||
{
|
||||
u8 buf[BIGSIZE_MAX_LEN];
|
||||
size_t len;
|
||||
|
||||
len = bigsize_put(buf, val);
|
||||
towire(pptr, buf, len);
|
||||
}
|
||||
|
||||
@@ -18,4 +18,15 @@ size_t bigsize_get(const u8 *p, size_t max, bigsize_t *val);
|
||||
/* How many bytes does it take to encode v? */
|
||||
size_t bigsize_len(bigsize_t v);
|
||||
|
||||
/* Used for wire generation */
|
||||
typedef bigsize_t bigsize;
|
||||
|
||||
/* FIXME: Some versions of spec using 'varint' for bigsize' */
|
||||
typedef bigsize varint;
|
||||
#define fromwire_varint fromwire_bigsize
|
||||
#define towire_varint towire_bigsize
|
||||
|
||||
/* marshal/unmarshal functions */
|
||||
void towire_bigsize(u8 **pptr, const bigsize_t val);
|
||||
bigsize_t fromwire_bigsize(const u8 **cursor, size_t *max);
|
||||
#endif /* LIGHTNING_COMMON_BIGSIZE_H */
|
||||
|
||||
@@ -23,3 +23,16 @@ void fromwire_ext_key(const u8 **cursor, size_t *max, struct ext_key *bip32)
|
||||
if (bip32_key_unserialize(in, BIP32_SERIALIZED_LEN, bip32) != WALLY_OK)
|
||||
fromwire_fail(cursor, max);
|
||||
}
|
||||
|
||||
void fromwire_bip32_key_version(const u8** cursor, size_t *max,
|
||||
struct bip32_key_version *version)
|
||||
{
|
||||
version->bip32_pubkey_version = fromwire_u32(cursor, max);
|
||||
version->bip32_privkey_version = fromwire_u32(cursor, max);
|
||||
}
|
||||
|
||||
void towire_bip32_key_version(u8 **pptr, const struct bip32_key_version *version)
|
||||
{
|
||||
towire_u32(pptr, version->bip32_pubkey_version);
|
||||
towire_u32(pptr, version->bip32_privkey_version);
|
||||
}
|
||||
|
||||
@@ -9,4 +9,13 @@ struct ext_key;
|
||||
void towire_ext_key(u8 **pptr, const struct ext_key *bip32);
|
||||
void fromwire_ext_key(const u8 **cursor, size_t *max, struct ext_key *bip32);
|
||||
|
||||
struct bip32_key_version {
|
||||
u32 bip32_pubkey_version;
|
||||
u32 bip32_privkey_version;
|
||||
};
|
||||
|
||||
void towire_bip32_key_version(u8 **cursor, const struct bip32_key_version *version);
|
||||
void fromwire_bip32_key_version(const u8 **cursor, size_t *max,
|
||||
struct bip32_key_version *version);
|
||||
|
||||
#endif /* LIGHTNING_COMMON_BIP32_H */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "features.h"
|
||||
#include <assert.h>
|
||||
#include <ccan/array_size/array_size.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/memleak.h>
|
||||
#include <common/utils.h>
|
||||
#include <wire/peer_wire.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <ccan/array_size/array_size.h>
|
||||
#include <ccan/cast/cast.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/fee_states.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <bitcoin/preimage.h>
|
||||
#include <bitcoin/privkey.h>
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <bitcoin/short_channel_id.h>
|
||||
#include <ccan/ccan/str/hex/hex.h>
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
struct amount_msat;
|
||||
struct amount_sat;
|
||||
struct channel_id;
|
||||
struct pubkey;
|
||||
struct node_id;
|
||||
struct preimage;
|
||||
struct pubkey;
|
||||
struct secret;
|
||||
struct short_channel_id;
|
||||
struct wireaddr;
|
||||
struct wireaddr_internal;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#include <assert.h>
|
||||
#include <ccan/array_size/array_size.h>
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <common/node_id.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/utils.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
/* Convert from pubkey to compressed pubkey. */
|
||||
void node_id_from_pubkey(struct node_id *id, const struct pubkey *key)
|
||||
@@ -48,3 +50,15 @@ int node_id_cmp(const struct node_id *a, const struct node_id *b)
|
||||
{
|
||||
return memcmp(a->k, b->k, sizeof(a->k));
|
||||
}
|
||||
|
||||
void fromwire_node_id(const u8 **cursor, size_t *max, struct node_id *id)
|
||||
{
|
||||
fromwire(cursor, max, &id->k, sizeof(id->k));
|
||||
}
|
||||
|
||||
void towire_node_id(u8 **pptr, const struct node_id *id)
|
||||
{
|
||||
/* Cheap sanity check */
|
||||
assert(id->k[0] == 0x2 || id->k[0] == 0x3);
|
||||
towire(pptr, id->k, sizeof(id->k));
|
||||
}
|
||||
|
||||
@@ -40,4 +40,7 @@ static inline int node_id_idx(const struct node_id *id1,
|
||||
return node_id_cmp(id1, id2) > 0;
|
||||
}
|
||||
|
||||
/* marshal/unmarshal functions */
|
||||
void towire_node_id(u8 **pptr, const struct node_id *id);
|
||||
void fromwire_node_id(const u8 **cursor, size_t *max, struct node_id *id);
|
||||
#endif /* LIGHTNING_COMMON_NODE_ID_H */
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <sodium/randombytes.h>
|
||||
#include <wire/gen_onion_wire.h>
|
||||
|
||||
struct node_id;
|
||||
|
||||
#define VERSION_SIZE 1
|
||||
#define REALM_SIZE 1
|
||||
#define HMAC_SIZE 32
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <common/per_peer_state.h>
|
||||
#include <common/node_id.h>
|
||||
#include <common/status_wire.h>
|
||||
|
||||
msgtype,status_log,0xFFF0
|
||||
|
||||
|
@@ -17,10 +17,9 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -44,9 +43,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <ccan/tal/grab_file/grab_file.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/amount.h>
|
||||
#include <common/json.c>
|
||||
#include <common/utils.h>
|
||||
#include <wire/wire.h>
|
||||
@@ -47,10 +48,9 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -99,9 +99,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
#include <wally_core.h>
|
||||
|
||||
/* AUTOGENERATED MOCKS START */
|
||||
/* Generated stub for bigsize_get */
|
||||
size_t bigsize_get(const u8 *p UNNEEDED, size_t max UNNEEDED, bigsize_t *val UNNEEDED)
|
||||
{ fprintf(stderr, "bigsize_get called!\n"); abort(); }
|
||||
/* Generated stub for bigsize_put */
|
||||
size_t bigsize_put(u8 buf[BIGSIZE_MAX_LEN] UNNEEDED, bigsize_t v UNNEEDED)
|
||||
{ fprintf(stderr, "bigsize_put called!\n"); abort(); }
|
||||
/* Generated stub for type_to_string_ */
|
||||
const char *type_to_string_(const tal_t *ctx UNNEEDED, const char *typename UNNEEDED,
|
||||
union printable_types u UNNEEDED)
|
||||
|
||||
@@ -43,10 +43,9 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -73,9 +72,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <ccan/structeq/structeq.h>
|
||||
#include <common/amount.h>
|
||||
#include <common/utils.h>
|
||||
#include <stdio.h>
|
||||
#include <wally_core.h>
|
||||
@@ -39,23 +40,13 @@ bool fromwire_bool(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
/* Generated stub for fromwire_fail */
|
||||
const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_fail called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_privkey */
|
||||
void fromwire_privkey(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct privkey *privkey UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_privkey called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_pubkey */
|
||||
void fromwire_pubkey(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct pubkey *pubkey UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_pubkey called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_secp256k1_ecdsa_signature */
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_secret */
|
||||
void fromwire_secret(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct secret *secret UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secret called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -78,22 +69,13 @@ void towire_amount_sat(u8 **pptr UNNEEDED, const struct amount_sat sat UNNEEDED)
|
||||
/* Generated stub for towire_bool */
|
||||
void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_bool called!\n"); abort(); }
|
||||
/* Generated stub for towire_privkey */
|
||||
void towire_privkey(u8 **pptr UNNEEDED, const struct privkey *privkey UNNEEDED)
|
||||
{ fprintf(stderr, "towire_privkey called!\n"); abort(); }
|
||||
/* Generated stub for towire_pubkey */
|
||||
void towire_pubkey(u8 **pptr UNNEEDED, const struct pubkey *pubkey UNNEEDED)
|
||||
{ fprintf(stderr, "towire_pubkey called!\n"); abort(); }
|
||||
/* Generated stub for towire_secp256k1_ecdsa_signature */
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_secret */
|
||||
void towire_secret(u8 **pptr UNNEEDED, const struct secret *secret UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secret called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -43,10 +43,9 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -73,9 +72,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -30,17 +30,13 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
/* Generated stub for fromwire_node_id */
|
||||
void fromwire_node_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct node_id *id UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_node_id called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_pubkey */
|
||||
void fromwire_pubkey(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct pubkey *pubkey UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_pubkey called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_secp256k1_ecdsa_signature */
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -66,16 +62,13 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
/* Generated stub for towire_node_id */
|
||||
void towire_node_id(u8 **pptr UNNEEDED, const struct node_id *id UNNEEDED)
|
||||
{ fprintf(stderr, "towire_node_id called!\n"); abort(); }
|
||||
/* Generated stub for towire_pubkey */
|
||||
void towire_pubkey(u8 **pptr UNNEEDED, const struct pubkey *pubkey UNNEEDED)
|
||||
{ fprintf(stderr, "towire_pubkey called!\n"); abort(); }
|
||||
/* Generated stub for towire_secp256k1_ecdsa_signature */
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -24,9 +24,6 @@ bool amount_sat_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNNEEDED)
|
||||
struct amount_sat a UNNEEDED,
|
||||
struct amount_sat b UNNEEDED)
|
||||
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
|
||||
/* Generated stub for bigsize_get */
|
||||
size_t bigsize_get(const u8 *p UNNEEDED, size_t max UNNEEDED, bigsize_t *val UNNEEDED)
|
||||
{ fprintf(stderr, "bigsize_get called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_amount_sat */
|
||||
struct amount_sat fromwire_amount_sat(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_amount_sat called!\n"); abort(); }
|
||||
@@ -46,9 +43,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <common/amount.h>
|
||||
|
||||
/* AUTOGENERATED MOCKS START */
|
||||
/* Generated stub for amount_asset_is_main */
|
||||
@@ -41,10 +42,9 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -74,9 +74,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "config.h"
|
||||
#include <common/amount.h>
|
||||
#include <common/utils.h>
|
||||
#include <common/json.c>
|
||||
#include <wire/wire.h>
|
||||
@@ -39,10 +40,9 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -91,9 +91,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <common/amount.h>
|
||||
#include <common/utils.h>
|
||||
#include <stdio.h>
|
||||
#include <wire/wire.h>
|
||||
@@ -44,10 +45,9 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -74,9 +74,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "../io_lock.c"
|
||||
#include <ccan/io/io.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <common/amount.h>
|
||||
#include <common/utils.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -43,10 +44,9 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -73,9 +73,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <assert.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <common/amount.h>
|
||||
#include <common/utils.h>
|
||||
#include <stdio.h>
|
||||
#include <wire/wire.h>
|
||||
@@ -40,10 +41,9 @@ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256_double */
|
||||
void fromwire_sha256_double(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||
struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_sha256 */
|
||||
void fromwire_sha256(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_tal_arrn */
|
||||
u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED,
|
||||
const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED)
|
||||
@@ -70,9 +70,9 @@ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED)
|
||||
void towire_secp256k1_ecdsa_signature(u8 **pptr UNNEEDED,
|
||||
const secp256k1_ecdsa_signature *signature UNNEEDED)
|
||||
{ fprintf(stderr, "towire_secp256k1_ecdsa_signature called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256_double */
|
||||
void towire_sha256_double(u8 **pptr UNNEEDED, const struct sha256_double *sha256d UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256_double called!\n"); abort(); }
|
||||
/* Generated stub for towire_sha256 */
|
||||
void towire_sha256(u8 **pptr UNNEEDED, const struct sha256 *sha256 UNNEEDED)
|
||||
{ fprintf(stderr, "towire_sha256 called!\n"); abort(); }
|
||||
/* Generated stub for towire_u16 */
|
||||
void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED)
|
||||
{ fprintf(stderr, "towire_u16 called!\n"); abort(); }
|
||||
|
||||
@@ -41,9 +41,6 @@ bool amount_sat_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNNEEDED)
|
||||
struct amount_sat a UNNEEDED,
|
||||
struct amount_sat b UNNEEDED)
|
||||
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
|
||||
/* Generated stub for bigsize_get */
|
||||
size_t bigsize_get(const u8 *p UNNEEDED, size_t max UNNEEDED, bigsize_t *val UNNEEDED)
|
||||
{ fprintf(stderr, "bigsize_get called!\n"); abort(); }
|
||||
/* Generated stub for bigsize_put */
|
||||
size_t bigsize_put(u8 buf[BIGSIZE_MAX_LEN] UNNEEDED, bigsize_t v UNNEEDED)
|
||||
{ fprintf(stderr, "bigsize_put called!\n"); abort(); }
|
||||
@@ -56,6 +53,9 @@ struct amount_msat fromwire_amount_msat(const u8 **cursor UNNEEDED, size_t *max
|
||||
/* Generated stub for fromwire_amount_sat */
|
||||
struct amount_sat fromwire_amount_sat(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_amount_sat called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_bigsize */
|
||||
bigsize_t fromwire_bigsize(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_bigsize called!\n"); abort(); }
|
||||
/* Generated stub for pubkey_from_node_id */
|
||||
bool pubkey_from_node_id(struct pubkey *key UNNEEDED, const struct node_id *id UNNEEDED)
|
||||
{ fprintf(stderr, "pubkey_from_node_id called!\n"); abort(); }
|
||||
@@ -65,6 +65,9 @@ void towire_amount_msat(u8 **pptr UNNEEDED, const struct amount_msat msat UNNEED
|
||||
/* Generated stub for towire_amount_sat */
|
||||
void towire_amount_sat(u8 **pptr UNNEEDED, const struct amount_sat sat UNNEEDED)
|
||||
{ fprintf(stderr, "towire_amount_sat called!\n"); abort(); }
|
||||
/* Generated stub for towire_bigsize */
|
||||
void towire_bigsize(u8 **pptr UNNEEDED, const bigsize_t val UNNEEDED)
|
||||
{ fprintf(stderr, "towire_bigsize called!\n"); abort(); }
|
||||
/* AUTOGENERATED MOCKS END */
|
||||
|
||||
extern secp256k1_context *secp256k1_ctx;
|
||||
|
||||
Reference in New Issue
Block a user