diff --git a/bitcoin/block.c b/bitcoin/block.c index 424f4f52b..3306e2582 100644 --- a/bitcoin/block.c +++ b/bitcoin/block.c @@ -3,6 +3,7 @@ #include "bitcoin/tx.h" #include #include +#include static void sha256_varint(struct sha256_ctx *ctx, u64 val) { @@ -206,3 +207,28 @@ static char *fmt_bitcoin_blkid(const tal_t *ctx, return hexstr; } REGISTER_TYPE_TO_STRING(bitcoin_blkid, fmt_bitcoin_blkid); + +void fromwire_bitcoin_blkid(const u8 **cursor, size_t *max, + struct bitcoin_blkid *blkid) +{ + fromwire_sha256_double(cursor, max, &blkid->shad); +} + +void towire_bitcoin_blkid(u8 **pptr, const struct bitcoin_blkid *blkid) +{ + towire_sha256_double(pptr, &blkid->shad); +} + + +void towire_chainparams(u8 **cursor, const struct chainparams *chainparams) +{ + towire_bitcoin_blkid(cursor, &chainparams->genesis_blockhash); +} + +void fromwire_chainparams(const u8 **cursor, size_t *max, + const struct chainparams **chainparams) +{ + struct bitcoin_blkid genesis; + fromwire_bitcoin_blkid(cursor, max, &genesis); + *chainparams = chainparams_by_chainhash(&genesis); +} diff --git a/bitcoin/block.h b/bitcoin/block.h index 7f82b8aa5..5239f372d 100644 --- a/bitcoin/block.h +++ b/bitcoin/block.h @@ -53,4 +53,13 @@ bool bitcoin_blkid_from_hex(const char *hexstr, size_t hexstr_len, /* Get hex string of blockid (reversed, a-la bitcoind). */ bool bitcoin_blkid_to_hex(const struct bitcoin_blkid *blockid, char *hexstr, size_t hexstr_len); + +/* Marshalling/unmarshaling over the wire */ +void towire_bitcoin_blkid(u8 **pptr, const struct bitcoin_blkid *blkid); +void fromwire_bitcoin_blkid(const u8 **cursor, size_t *max, + struct bitcoin_blkid *blkid); +void fromwire_chainparams(const u8 **cursor, size_t *max, + const struct chainparams **chainparams); +void towire_chainparams(u8 **cursor, const struct chainparams *chainparams); + #endif /* LIGHTNING_BITCOIN_BLOCK_H */ diff --git a/bitcoin/chainparams.c b/bitcoin/chainparams.c index 6147524d3..5a79e7e8e 100644 --- a/bitcoin/chainparams.c +++ b/bitcoin/chainparams.c @@ -256,3 +256,4 @@ const char *chainparams_get_network_names(const tal_t *ctx) tal_append_fmt(&networks_string, ", %s", networks[i].network_name); return networks_string; } + diff --git a/bitcoin/signature.c b/bitcoin/signature.c index 3a308bb46..ffed8aaac 100644 --- a/bitcoin/signature.c +++ b/bitcoin/signature.c @@ -9,6 +9,7 @@ #include #include #include +#include #undef DEBUG #ifdef DEBUG @@ -323,3 +324,19 @@ static char *bitcoin_signature_to_hexstr(const tal_t *ctx, return tal_hexstr(ctx, der, len); } REGISTER_TYPE_TO_STRING(bitcoin_signature, bitcoin_signature_to_hexstr); + +void fromwire_bitcoin_signature(const u8 **cursor, size_t *max, + struct bitcoin_signature *sig) +{ + fromwire_secp256k1_ecdsa_signature(cursor, max, &sig->s); + sig->sighash_type = fromwire_u8(cursor, max); + if (!sighash_type_valid(sig->sighash_type)) + fromwire_fail(cursor, max); +} + +void towire_bitcoin_signature(u8 **pptr, const struct bitcoin_signature *sig) +{ + assert(sighash_type_valid(sig->sighash_type)); + towire_secp256k1_ecdsa_signature(pptr, &sig->s); + towire_u8(pptr, sig->sighash_type); +} diff --git a/bitcoin/signature.h b/bitcoin/signature.h index 28df2bd2c..8aa929563 100644 --- a/bitcoin/signature.h +++ b/bitcoin/signature.h @@ -126,4 +126,9 @@ size_t signature_to_der(u8 der[73], const struct bitcoin_signature *sig); /* Parse DER encoding into signature sig */ bool signature_from_der(const u8 *der, size_t len, struct bitcoin_signature *sig); +/* Wire marshalling and unmarshalling */ +void towire_bitcoin_signature(u8 **pptr, const struct bitcoin_signature *sig); +void fromwire_bitcoin_signature(const u8 **cursor, size_t *max, + struct bitcoin_signature *sig); + #endif /* LIGHTNING_BITCOIN_SIGNATURE_H */ diff --git a/bitcoin/test/run-bitcoin_block_from_hex.c b/bitcoin/test/run-bitcoin_block_from_hex.c index fd9f1bf15..2d028f009 100644 --- a/bitcoin/test/run-bitcoin_block_from_hex.c +++ b/bitcoin/test/run-bitcoin_block_from_hex.c @@ -25,9 +25,35 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ static const char block[] = diff --git a/bitcoin/test/run-tx-encode.c b/bitcoin/test/run-tx-encode.c index 172930d7e..8f69a760a 100644 --- a/bitcoin/test/run-tx-encode.c +++ b/bitcoin/test/run-tx-encode.c @@ -26,9 +26,35 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ const char extended_tx[] = diff --git a/bitcoin/tx.c b/bitcoin/tx.c index 2bffd7677..e529326a1 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -586,3 +586,100 @@ static char *fmt_bitcoin_txid(const tal_t *ctx, const struct bitcoin_txid *txid) REGISTER_TYPE_TO_STRING(bitcoin_tx, fmt_bitcoin_tx); REGISTER_TYPE_TO_STRING(bitcoin_txid, fmt_bitcoin_txid); + +void fromwire_bitcoin_txid(const u8 **cursor, size_t *max, + struct bitcoin_txid *txid) +{ + fromwire_sha256_double(cursor, max, &txid->shad); +} + +struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx, + const u8 **cursor, size_t *max) +{ + struct bitcoin_tx *tx; + u16 input_amts_len; + size_t i; + + tx = pull_bitcoin_tx(ctx, cursor, max); + input_amts_len = fromwire_u16(cursor, max); + /* We don't serialize the amounts if they're not *all* populated */ + if (input_amts_len != tal_count(tx->input_amounts)) + return tx; + + for (i = 0; i < input_amts_len; i++) { + struct amount_sat sat; + sat = fromwire_amount_sat(cursor, max); + tx->input_amounts[i] = + tal_dup(tx, struct amount_sat, &sat); + } + + return tx; +} + +void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid) +{ + towire_sha256_double(pptr, &txid->shad); +} + +void towire_bitcoin_tx(u8 **pptr, const struct bitcoin_tx *tx) +{ + size_t i; + u8 *lin = linearize_tx(tmpctx, tx); + towire_u8_array(pptr, lin, tal_count(lin)); + + /* We only want to 'save' the amounts if every amount + * has been populated */ + for (i = 0; i < tal_count(tx->input_amounts); i++) { + if (!tx->input_amounts[i]) { + towire_u16(pptr, 0); + return; + } + } + + /* Otherwise, we include the input amount set */ + towire_u16(pptr, tal_count(tx->input_amounts)); + for (i = 0; i < tal_count(tx->input_amounts); i++) { + assert(tx->input_amounts[i]); + towire_amount_sat(pptr, *tx->input_amounts[i]); + } +} + +struct bitcoin_tx_output *fromwire_bitcoin_tx_output(const tal_t *ctx, + const u8 **cursor, size_t *max) +{ + struct bitcoin_tx_output *output = tal(ctx, struct bitcoin_tx_output); + output->amount = fromwire_amount_sat(cursor, max); + u16 script_len = fromwire_u16(cursor, max); + output->script = fromwire_tal_arrn(output, cursor, max, script_len); + if (!*cursor) + return tal_free(output); + return output; +} + +void towire_bitcoin_tx_output(u8 **pptr, const struct bitcoin_tx_output *output) +{ + towire_amount_sat(pptr, output->amount); + towire_u16(pptr, tal_count(output->script)); + towire_u8_array(pptr, output->script, tal_count(output->script)); +} + +void towire_witscript(u8 **pptr, const struct witscript *script) +{ + if (script == NULL) { + towire_u16(pptr, 0); + } else { + assert(script->ptr != NULL); + towire_u16(pptr, tal_count(script->ptr)); + towire_u8_array(pptr, script->ptr, tal_count(script->ptr)); + } +} + +struct witscript *fromwire_witscript(const tal_t *ctx, const u8 **cursor, size_t *max) +{ + struct witscript *retval = tal(ctx, struct witscript); + u16 len = fromwire_u16(cursor, max); + retval->ptr = fromwire_tal_arrn(retval, cursor, max, len); + if (!*cursor) + return tal_free(retval); + return retval; +} diff --git a/bitcoin/tx.h b/bitcoin/tx.h index fa767cf14..13651d6b2 100644 --- a/bitcoin/tx.h +++ b/bitcoin/tx.h @@ -180,4 +180,19 @@ struct amount_sat bitcoin_tx_compute_fee(const struct bitcoin_tx *tx); struct amount_sat bitcoin_tx_compute_fee_w_inputs(const struct bitcoin_tx *tx, struct amount_sat input_val); +/* Wire marshalling and unmarshalling */ +void fromwire_bitcoin_txid(const u8 **cursor, size_t *max, + struct bitcoin_txid *txid); +struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx, + const u8 **cursor, size_t *max); +struct bitcoin_tx_output *fromwire_bitcoin_tx_output(const tal_t *ctx, + const u8 **cursor, size_t *max); +struct witscript *fromwire_witscript(const tal_t *ctx, + const u8 **cursor, size_t *max); + +void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid); +void towire_bitcoin_tx(u8 **pptr, const struct bitcoin_tx *tx); +void towire_bitcoin_tx_output(u8 **pptr, const struct bitcoin_tx_output *output); +void towire_witscript(u8 **pptr, const struct witscript *script); + #endif /* LIGHTNING_BITCOIN_TX_H */ diff --git a/closingd/closing_wire.csv b/closingd/closing_wire.csv index f2b0e3776..abf8eb79d 100644 --- a/closingd/closing_wire.csv +++ b/closingd/closing_wire.csv @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/common/test/run-amount.c b/common/test/run-amount.c index 3b3e5596d..2216e844f 100644 --- a/common/test/run-amount.c +++ b/common/test/run-amount.c @@ -4,9 +4,49 @@ #include /* AUTOGENERATED MOCKS START */ +/* 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ #define FAIL_MSAT(msatp, str) \ diff --git a/common/test/run-bigsize.c b/common/test/run-bigsize.c index b933bc073..516cfbdfe 100644 --- a/common/test/run-bigsize.c +++ b/common/test/run-bigsize.c @@ -31,9 +31,30 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } /* Generated stub for json_add_member */ void json_add_member(struct json_stream *js UNNEEDED, const char *fieldname UNNEEDED, @@ -56,6 +77,25 @@ void json_object_end(struct json_stream *js UNNEEDED) /* Generated stub for json_object_start */ void json_object_start(struct json_stream *ks UNNEEDED, const char *fieldname UNNEEDED) { fprintf(stderr, "json_object_start called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ /* BOLT #1: diff --git a/common/test/run-cryptomsg.c b/common/test/run-cryptomsg.c index f5ee472eb..de336f97a 100644 --- a/common/test/run-cryptomsg.c +++ b/common/test/run-cryptomsg.c @@ -27,9 +27,49 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ void status_fmt(enum log_level level UNUSED, diff --git a/common/test/run-derive_basepoints.c b/common/test/run-derive_basepoints.c index 34dc8a6ad..3a2466436 100644 --- a/common/test/run-derive_basepoints.c +++ b/common/test/run-derive_basepoints.c @@ -27,6 +27,9 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail called!\n"); abort(); } @@ -36,18 +39,55 @@ void fromwire_privkey(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct p /* 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ STRUCTEQ_DEF(basepoints, 0, diff --git a/common/test/run-features.c b/common/test/run-features.c index 02187068d..8feb0ee1b 100644 --- a/common/test/run-features.c +++ b/common/test/run-features.c @@ -27,9 +27,20 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) @@ -37,9 +48,25 @@ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, /* Generated stub for fromwire_u16 */ u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* 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_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_u16 */ void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) { fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } /* Generated stub for towire_u8_array */ void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) { fprintf(stderr, "towire_u8_array called!\n"); abort(); } diff --git a/common/test/run-funding_tx.c b/common/test/run-funding_tx.c index d5891715a..9d007e8f0 100644 --- a/common/test/run-funding_tx.c +++ b/common/test/run-funding_tx.c @@ -21,10 +21,6 @@ /* 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_bitcoin_txid */ -void fromwire_bitcoin_txid(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, - struct bitcoin_txid *txid UNNEEDED) -{ fprintf(stderr, "fromwire_bitcoin_txid called!\n"); abort(); } /* Generated stub for fromwire_bool */ bool fromwire_bool(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_bool called!\n"); abort(); } @@ -37,6 +33,14 @@ void fromwire_node_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct n /* 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_tal_arrn */ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) @@ -50,12 +54,12 @@ u32 fromwire_u32(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) /* Generated stub for fromwire_u64 */ u64 fromwire_u64(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_u64 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } /* 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_bitcoin_txid */ -void towire_bitcoin_txid(u8 **pptr UNNEEDED, const struct bitcoin_txid *txid UNNEEDED) -{ fprintf(stderr, "towire_bitcoin_txid called!\n"); abort(); } /* Generated stub for towire_bool */ void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED) { fprintf(stderr, "towire_bool called!\n"); abort(); } @@ -65,6 +69,13 @@ void towire_node_id(u8 **pptr UNNEEDED, const struct node_id *id UNNEEDED) /* 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_u16 */ void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) { fprintf(stderr, "towire_u16 called!\n"); abort(); } @@ -74,6 +85,9 @@ void towire_u32(u8 **pptr UNNEEDED, u32 v UNNEEDED) /* Generated stub for towire_u64 */ void towire_u64(u8 **pptr UNNEEDED, u64 v UNNEEDED) { fprintf(stderr, "towire_u64 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } /* Generated stub for towire_u8_array */ void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) { fprintf(stderr, "towire_u8_array called!\n"); abort(); } diff --git a/common/test/run-gossip_rcvd_filter.c b/common/test/run-gossip_rcvd_filter.c index 8b43b8074..26d8aee61 100644 --- a/common/test/run-gossip_rcvd_filter.c +++ b/common/test/run-gossip_rcvd_filter.c @@ -30,6 +30,25 @@ size_t bigsize_get(const u8 *p UNNEEDED, size_t max UNNEEDED, bigsize_t *val UNN /* Generated stub for memleak_remove_htable */ void memleak_remove_htable(struct htable *memtable UNNEEDED, const struct htable *ht UNNEEDED) { fprintf(stderr, "memleak_remove_htable called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ void memleak_add_helper_(const tal_t *p UNNEEDED, diff --git a/common/test/run-ip_port_parsing.c b/common/test/run-ip_port_parsing.c index 51ae60cd5..0144d7690 100644 --- a/common/test/run-ip_port_parsing.c +++ b/common/test/run-ip_port_parsing.c @@ -28,9 +28,24 @@ bool amount_sat_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNNEEDED) /* Generated stub for fromwire */ const u8 *fromwire(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, void *copy UNNEEDED, size_t n UNNEEDED) { fprintf(stderr, "fromwire 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(); } /* 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_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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } /* Generated stub for fromwire_u16 */ u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_u16 called!\n"); abort(); } @@ -43,6 +58,16 @@ void fromwire_u8_array(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, u8 *arr /* Generated stub for towire */ void towire(u8 **pptr UNNEEDED, const void *data UNNEEDED, size_t len UNNEEDED) { fprintf(stderr, "towire called!\n"); abort(); } +/* 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_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_u16 */ void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) { fprintf(stderr, "towire_u16 called!\n"); abort(); } diff --git a/common/test/run-json_remove.c b/common/test/run-json_remove.c index 86a0fafa6..0537b242e 100644 --- a/common/test/run-json_remove.c +++ b/common/test/run-json_remove.c @@ -23,9 +23,30 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } /* Generated stub for json_add_member */ void json_add_member(struct json_stream *js UNNEEDED, const char *fieldname UNNEEDED, @@ -48,6 +69,25 @@ void json_object_end(struct json_stream *js UNNEEDED) /* Generated stub for json_object_start */ void json_object_start(struct json_stream *ks UNNEEDED, const char *fieldname UNNEEDED) { fprintf(stderr, "json_object_start called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ struct json { diff --git a/common/test/run-key_derive.c b/common/test/run-key_derive.c index 2e63af3f0..832248c5c 100644 --- a/common/test/run-key_derive.c +++ b/common/test/run-key_derive.c @@ -28,9 +28,49 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ static struct secret secret_from_hex(const char *hex) diff --git a/common/test/run-lock.c b/common/test/run-lock.c index 4c62ebec0..246156881 100644 --- a/common/test/run-lock.c +++ b/common/test/run-lock.c @@ -27,9 +27,49 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ #define num_writers 10 diff --git a/common/test/run-softref.c b/common/test/run-softref.c index 163a5a2c2..04f57a806 100644 --- a/common/test/run-softref.c +++ b/common/test/run-softref.c @@ -23,9 +23,49 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ +u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, + const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_tal_arrn called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* 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_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_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ struct objtype { diff --git a/connectd/test/run-initiator-success.c b/connectd/test/run-initiator-success.c index 6bac4323c..43a4a52fb 100644 --- a/connectd/test/run-initiator-success.c +++ b/connectd/test/run-initiator-success.c @@ -30,9 +30,20 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) @@ -40,9 +51,25 @@ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, /* Generated stub for fromwire_u16 */ u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* 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_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_u16 */ void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) { fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } /* Generated stub for towire_u8_array */ void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) { fprintf(stderr, "towire_u8_array called!\n"); abort(); } diff --git a/connectd/test/run-responder-success.c b/connectd/test/run-responder-success.c index 5657d1780..a3bcb78fb 100644 --- a/connectd/test/run-responder-success.c +++ b/connectd/test/run-responder-success.c @@ -30,9 +30,20 @@ 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 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_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail 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_tal_arrn */ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) @@ -40,9 +51,25 @@ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, /* Generated stub for fromwire_u16 */ u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* 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_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_u16 */ void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) { fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } /* Generated stub for towire_u8_array */ void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) { fprintf(stderr, "towire_u8_array called!\n"); abort(); } diff --git a/onchaind/test/run-grind_feerate-bug.c b/onchaind/test/run-grind_feerate-bug.c index 9fd652cf9..780ea69a4 100644 --- a/onchaind/test/run-grind_feerate-bug.c +++ b/onchaind/test/run-grind_feerate-bug.c @@ -27,6 +27,9 @@ bool derive_keyset(const struct pubkey *per_commitment_point UNNEEDED, /* Generated stub for dump_memleak */ bool dump_memleak(struct htable *memtable UNNEEDED) { fprintf(stderr, "dump_memleak 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(); } /* Generated stub for fromwire_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail called!\n"); abort(); } @@ -54,6 +57,14 @@ bool fromwire_onchain_spent(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, s /* Generated stub for fromwire_peektype */ int fromwire_peektype(const u8 *cursor UNNEEDED) { fprintf(stderr, "fromwire_peektype 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_tal_arrn */ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) @@ -61,6 +72,9 @@ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, /* Generated stub for fromwire_u16 */ u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } /* Generated stub for htlc_offered_wscript */ u8 *htlc_offered_wscript(const tal_t *ctx UNNEEDED, const struct ripemd160 *ripemd UNNEEDED, @@ -188,6 +202,9 @@ u8 *to_self_wscript(const tal_t *ctx UNNEEDED, u16 to_self_delay UNNEEDED, const struct keyset *keyset UNNEEDED) { fprintf(stderr, "to_self_wscript called!\n"); abort(); } +/* 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_hsm_get_per_commitment_point */ u8 *towire_hsm_get_per_commitment_point(const tal_t *ctx UNNEEDED, u64 n UNNEEDED) { fprintf(stderr, "towire_hsm_get_per_commitment_point called!\n"); abort(); } @@ -236,9 +253,19 @@ u8 *towire_onchain_notify_coin_mvt(const tal_t *ctx UNNEEDED, const struct chain /* Generated stub for towire_onchain_unwatch_tx */ u8 *towire_onchain_unwatch_tx(const tal_t *ctx UNNEEDED, const struct bitcoin_txid *txid UNNEEDED) { fprintf(stderr, "towire_onchain_unwatch_tx 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_u16 */ void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) { fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } /* Generated stub for towire_u8_array */ void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) { fprintf(stderr, "towire_u8_array called!\n"); abort(); } diff --git a/onchaind/test/run-grind_feerate.c b/onchaind/test/run-grind_feerate.c index e1ca00571..3295814e2 100644 --- a/onchaind/test/run-grind_feerate.c +++ b/onchaind/test/run-grind_feerate.c @@ -28,6 +28,9 @@ bool derive_keyset(const struct pubkey *per_commitment_point UNNEEDED, /* Generated stub for dump_memleak */ bool dump_memleak(struct htable *memtable UNNEEDED) { fprintf(stderr, "dump_memleak 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(); } /* Generated stub for fromwire_fail */ const void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_fail called!\n"); abort(); } @@ -55,6 +58,14 @@ bool fromwire_onchain_known_preimage(const void *p UNNEEDED, struct preimage *pr /* Generated stub for fromwire_onchain_spent */ bool fromwire_onchain_spent(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct bitcoin_tx **tx UNNEEDED, u32 *input_num UNNEEDED, u32 *blockheight UNNEEDED, bool *is_replay UNNEEDED) { fprintf(stderr, "fromwire_onchain_spent 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_tal_arrn */ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, const u8 **cursor UNNEEDED, size_t *max UNNEEDED, size_t num UNNEEDED) @@ -62,6 +73,9 @@ u8 *fromwire_tal_arrn(const tal_t *ctx UNNEEDED, /* Generated stub for fromwire_u16 */ u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } /* Generated stub for htlc_offered_wscript */ u8 *htlc_offered_wscript(const tal_t *ctx UNNEEDED, const struct ripemd160 *ripemd UNNEEDED, @@ -203,6 +217,9 @@ u8 *to_self_wscript(const tal_t *ctx UNNEEDED, u16 to_self_delay UNNEEDED, const struct keyset *keyset UNNEEDED) { fprintf(stderr, "to_self_wscript called!\n"); abort(); } +/* 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_hsm_get_per_commitment_point */ u8 *towire_hsm_get_per_commitment_point(const tal_t *ctx UNNEEDED, u64 n UNNEEDED) { fprintf(stderr, "towire_hsm_get_per_commitment_point called!\n"); abort(); } @@ -254,9 +271,19 @@ u8 *towire_onchain_notify_coin_mvt(const tal_t *ctx UNNEEDED, const struct chain /* Generated stub for towire_onchain_unwatch_tx */ u8 *towire_onchain_unwatch_tx(const tal_t *ctx UNNEEDED, const struct bitcoin_txid *txid UNNEEDED) { fprintf(stderr, "towire_onchain_unwatch_tx 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_u16 */ void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) { fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } /* Generated stub for towire_u8_array */ void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) { fprintf(stderr, "towire_u8_array called!\n"); abort(); } diff --git a/wire/Makefile b/wire/Makefile index 02d2de0dd..86622b7e9 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -74,7 +74,7 @@ wire/gen_peer_wire_csv wire/gen_onion_wire_csv: config.vars # for testing and to prevent compile error about them being unused. # This will be easier if test vectors are moved to separate files. wire/gen_peer_wire.h: wire/gen_peer_wire_csv $(WIRE_BOLT_DEPS) wire/Makefile - $(BOLT_GEN) --include='common/channel_id.h' -s --expose-tlv-type=n1 --expose-tlv-type=n2 --page header $@ wire_type < $< > $@ + $(BOLT_GEN) --include='common/channel_id.h' --include='bitcoin/tx.h' -s --expose-tlv-type=n1 --expose-tlv-type=n2 --page header $@ wire_type < $< > $@ wire/gen_peer_wire.c: wire/gen_peer_wire_csv $(WIRE_BOLT_DEPS) wire/Makefile $(BOLT_GEN) -s --expose-tlv-type=n1 --expose-tlv-type=n2 --page impl ${@:.c=.h} wire_type < $< > $@ diff --git a/wire/fromwire.c b/wire/fromwire.c index 54a4c16b3..d90732eab 100644 --- a/wire/fromwire.c +++ b/wire/fromwire.c @@ -266,27 +266,6 @@ void fromwire_sha256_double(const u8 **cursor, size_t *max, fromwire_sha256(cursor, max, &sha256d->sha); } -void fromwire_bitcoin_txid(const u8 **cursor, size_t *max, - struct bitcoin_txid *txid) -{ - fromwire_sha256_double(cursor, max, &txid->shad); -} - -void fromwire_bitcoin_signature(const u8 **cursor, size_t *max, - struct bitcoin_signature *sig) -{ - fromwire_secp256k1_ecdsa_signature(cursor, max, &sig->s); - sig->sighash_type = fromwire_u8(cursor, max); - if (!sighash_type_valid(sig->sighash_type)) - fromwire_fail(cursor, max); -} - -void fromwire_bitcoin_blkid(const u8 **cursor, size_t *max, - struct bitcoin_blkid *blkid) -{ - fromwire_sha256_double(cursor, max, &blkid->shad); -} - void fromwire_preimage(const u8 **cursor, size_t *max, struct preimage *preimage) { fromwire(cursor, max, preimage, sizeof(*preimage)); @@ -341,29 +320,6 @@ char *fromwire_wirestring(const tal_t *ctx, const u8 **cursor, size_t *max) return NULL; } -struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx, - const u8 **cursor, size_t *max) -{ - struct bitcoin_tx *tx; - u16 input_amts_len; - size_t i; - - tx = pull_bitcoin_tx(ctx, cursor, max); - input_amts_len = fromwire_u16(cursor, max); - /* We don't serialize the amounts if they're not *all* populated */ - if (input_amts_len != tal_count(tx->input_amounts)) - return tx; - - for (i = 0; i < input_amts_len; i++) { - struct amount_sat sat; - sat = fromwire_amount_sat(cursor, max); - tx->input_amounts[i] = - tal_dup(tx, struct amount_sat, &sat); - } - - return tx; -} - void fromwire_siphash_seed(const u8 **cursor, size_t *max, struct siphash_seed *seed) { @@ -392,33 +348,3 @@ void fromwire_bip32_key_version(const u8** cursor, size_t *max, version->bip32_pubkey_version = fromwire_u32(cursor, max); version->bip32_privkey_version = fromwire_u32(cursor, max); } - -struct bitcoin_tx_output *fromwire_bitcoin_tx_output(const tal_t *ctx, - const u8 **cursor, size_t *max) -{ - struct bitcoin_tx_output *output = tal(ctx, struct bitcoin_tx_output); - output->amount = fromwire_amount_sat(cursor, max); - u16 script_len = fromwire_u16(cursor, max); - output->script = fromwire_tal_arrn(output, cursor, max, script_len); - if (!*cursor) - return tal_free(output); - return output; -} - -struct witscript *fromwire_witscript(const tal_t *ctx, const u8 **cursor, size_t *max) -{ - struct witscript *retval = tal(ctx, struct witscript); - u16 len = fromwire_u16(cursor, max); - retval->ptr = fromwire_tal_arrn(retval, cursor, max, len); - if (!*cursor) - return tal_free(retval); - return retval; -} - -void fromwire_chainparams(const u8 **cursor, size_t *max, - const struct chainparams **chainparams) -{ - struct bitcoin_blkid genesis; - fromwire_bitcoin_blkid(cursor, max, &genesis); - *chainparams = chainparams_by_chainhash(&genesis); -} diff --git a/wire/towire.c b/wire/towire.c index 1a351f960..5efbf2526 100644 --- a/wire/towire.c +++ b/wire/towire.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -173,23 +172,6 @@ void towire_sha256_double(u8 **pptr, const struct sha256_double *sha256d) towire_sha256(pptr, &sha256d->sha); } -void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid) -{ - towire_sha256_double(pptr, &txid->shad); -} - -void towire_bitcoin_signature(u8 **pptr, const struct bitcoin_signature *sig) -{ - assert(sighash_type_valid(sig->sighash_type)); - towire_secp256k1_ecdsa_signature(pptr, &sig->s); - towire_u8(pptr, sig->sighash_type); -} - -void towire_bitcoin_blkid(u8 **pptr, const struct bitcoin_blkid *blkid) -{ - towire_sha256_double(pptr, &blkid->shad); -} - void towire_preimage(u8 **pptr, const struct preimage *preimage) { towire(pptr, preimage, sizeof(*preimage)); @@ -219,29 +201,6 @@ void towire_wirestring(u8 **pptr, const char *str) towire(pptr, str, strlen(str) + 1); } -void towire_bitcoin_tx(u8 **pptr, const struct bitcoin_tx *tx) -{ - size_t i; - u8 *lin = linearize_tx(tmpctx, tx); - towire_u8_array(pptr, lin, tal_count(lin)); - - /* We only want to 'save' the amounts if every amount - * has been populated */ - for (i = 0; i < tal_count(tx->input_amounts); i++) { - if (!tx->input_amounts[i]) { - towire_u16(pptr, 0); - return; - } - } - - /* Otherwise, we include the input amount set */ - towire_u16(pptr, tal_count(tx->input_amounts)); - for (i = 0; i < tal_count(tx->input_amounts); i++) { - assert(tx->input_amounts[i]); - towire_amount_sat(pptr, *tx->input_amounts[i]); - } -} - void towire_siphash_seed(u8 **pptr, const struct siphash_seed *seed) { towire(pptr, seed, sizeof(*seed)); @@ -262,26 +221,3 @@ 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); } - -void towire_bitcoin_tx_output(u8 **pptr, const struct bitcoin_tx_output *output) -{ - towire_amount_sat(pptr, output->amount); - towire_u16(pptr, tal_count(output->script)); - towire_u8_array(pptr, output->script, tal_count(output->script)); -} - -void towire_witscript(u8 **pptr, const struct witscript *script) -{ - if (script == NULL) { - towire_u16(pptr, 0); - } else { - assert(script->ptr != NULL); - towire_u16(pptr, tal_count(script->ptr)); - towire_u8_array(pptr, script->ptr, tal_count(script->ptr)); - } -} - -void towire_chainparams(u8 **cursor, const struct chainparams *chainparams) -{ - towire_bitcoin_blkid(cursor, &chainparams->genesis_blockhash); -} diff --git a/wire/wire.h b/wire/wire.h index 3d4f3294e..44471281e 100644 --- a/wire/wire.h +++ b/wire/wire.h @@ -19,9 +19,6 @@ #include -struct bitcoin_blkid; -struct bitcoin_signature; -struct bitcoin_txid; struct preimage; struct ripemd160; struct siphash_seed; @@ -55,9 +52,6 @@ void towire_short_channel_id_dir(u8 **pptr, const struct short_channel_id_dir *scidd); void towire_sha256(u8 **pptr, const struct sha256 *sha256); void towire_sha256_double(u8 **pptr, const struct sha256_double *sha256d); -void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid); -void towire_bitcoin_signature(u8 **pptr, const struct bitcoin_signature *sig); -void towire_bitcoin_blkid(u8 **pptr, const struct bitcoin_blkid *blkid); void towire_preimage(u8 **pptr, const struct preimage *preimage); void towire_ripemd160(u8 **pptr, const struct ripemd160 *ripemd); void towire_amount_msat(u8 **pptr, const struct amount_msat msat); @@ -76,14 +70,10 @@ void towire_bigsize(u8 **pptr, const bigsize_t val); void towire_u8_array(u8 **pptr, const u8 *arr, size_t num); -void towire_bitcoin_tx(u8 **pptr, const struct bitcoin_tx *tx); void towire_wirestring(u8 **pptr, const char *str); void towire_siphash_seed(u8 **cursor, const struct siphash_seed *seed); void towire_bip32_key_version(u8 **cursor, const struct bip32_key_version *version); -void towire_bitcoin_tx_output(u8 **pptr, const struct bitcoin_tx_output *output); -void towire_witscript(u8 **pptr, const struct witscript *script); -void towire_chainparams(u8 **cursor, const struct chainparams *chainparams); const u8 *fromwire(const u8 **cursor, size_t *max, void *copy, size_t n); u8 fromwire_u8(const u8 **cursor, size_t *max); @@ -112,12 +102,6 @@ void fromwire_short_channel_id_dir(const u8 **cursor, size_t *max, void fromwire_sha256(const u8 **cursor, size_t *max, struct sha256 *sha256); void fromwire_sha256_double(const u8 **cursor, size_t *max, struct sha256_double *sha256d); -void fromwire_bitcoin_signature(const u8 **cursor, size_t *max, - struct bitcoin_signature *sig); -void fromwire_bitcoin_txid(const u8 **cursor, size_t *max, - struct bitcoin_txid *txid); -void fromwire_bitcoin_blkid(const u8 **cursor, size_t *max, - struct bitcoin_blkid *blkid); void fromwire_preimage(const u8 **cursor, size_t *max, struct preimage *preimage); void fromwire_ripemd160(const u8 **cursor, size_t *max, struct ripemd160 *ripemd); struct amount_msat fromwire_amount_msat(const u8 **cursor, size_t *max); @@ -128,19 +112,10 @@ void fromwire_u8_array(const u8 **cursor, size_t *max, u8 *arr, size_t num); u8 *fromwire_tal_arrn(const tal_t *ctx, const u8 **cursor, size_t *max, size_t num); char *fromwire_wirestring(const tal_t *ctx, const u8 **cursor, size_t *max); -struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx, - const u8 **cursor, size_t *max); void fromwire_siphash_seed(const u8 **cursor, size_t *max, struct siphash_seed *seed); void fromwire_bip32_key_version(const u8 **cursor, size_t *max, struct bip32_key_version *version); -struct bitcoin_tx_output *fromwire_bitcoin_tx_output(const tal_t *ctx, - const u8 **cursor, size_t *max); -struct witscript *fromwire_witscript(const tal_t *ctx, - const u8 **cursor, size_t *max); - -void fromwire_chainparams(const u8 **cursor, size_t *max, - const struct chainparams **chainparams); #if !EXPERIMENTAL_FEATURES /* Stubs, as this subtype is only defined when EXPERIMENTAL_FEATURES */