Browse Source

elements: convenience methods for dealing with assets

We don't preserve detailed asset information at the moment, so provide a
way to convert from a sat to an amount_asset struct.

We also need a way to convert from an 'amount_asset' to a 'value' for
elements, which for explicit (i.e. non-blinded) asssets is a 0x01 prefix
plus the big-endian encoded value.
paymod-04
niftynei 5 years ago
committed by Rusty Russell
parent
commit
bc5a817100
  1. 6
      bitcoin/test/run-bitcoin_block_from_hex.c
  2. 6
      bitcoin/test/run-tx-encode.c
  3. 6
      cli/test/run-large-input.c
  4. 6
      cli/test/run-remove-hint.c
  5. 24
      common/amount.c
  6. 9
      common/amount.h
  7. 6
      common/test/run-bigsize.c
  8. 6
      common/test/run-cryptomsg.c
  9. 6
      common/test/run-derive_basepoints.c
  10. 6
      common/test/run-features.c
  11. 6
      common/test/run-gossip_rcvd_filter.c
  12. 6
      common/test/run-ip_port_parsing.c
  13. 6
      common/test/run-json_remove.c
  14. 6
      common/test/run-key_derive.c
  15. 6
      common/test/run-lock.c
  16. 6
      common/test/run-softref.c
  17. 6
      common/test/run-sphinx.c
  18. 6
      connectd/test/run-initiator-success.c
  19. 6
      connectd/test/run-responder-success.c

6
bitcoin/test/run-bitcoin_block_from_hex.c

@ -7,6 +7,9 @@
#include <common/setup.h> #include <common/setup.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -29,6 +32,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
bitcoin/test/run-tx-encode.c

@ -8,6 +8,9 @@
#include <common/utils.h> #include <common/utils.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -30,6 +33,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
cli/test/run-large-input.c

@ -33,6 +33,9 @@ int test_chdir(const char *path);
#undef main #undef main
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -55,6 +58,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
cli/test/run-remove-hint.c

@ -36,6 +36,9 @@ int test_chdir(const char *path);
#undef main #undef main
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -58,6 +61,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

24
common/amount.c

@ -1,5 +1,6 @@
#include <assert.h> #include <assert.h>
#include <bitcoin/chainparams.h> #include <bitcoin/chainparams.h>
#include <ccan/endian/endian.h>
#include <ccan/mem/mem.h> #include <ccan/mem/mem.h>
#include <ccan/tal/str/str.h> #include <ccan/tal/str/str.h>
#include <common/amount.h> #include <common/amount.h>
@ -478,6 +479,29 @@ struct amount_sat amount_asset_to_sat(struct amount_asset *amount)
return sats; return sats;
} }
struct amount_asset amount_sat_to_asset(struct amount_sat *sat, const u8 *asset) {
struct amount_asset amt_asset;
assert(33 == sizeof(amt_asset.asset));
memcpy(amt_asset.asset, asset, sizeof(amt_asset.asset));
amt_asset.value = sat->satoshis; /* Raw: type conversion */
return amt_asset;
}
u8 *amount_asset_extract_value(const tal_t *ctx, struct amount_asset *asset)
{
u8 *val = tal_arr(ctx, u8, 9);
/* FIXME: persist blinded values */
if (asset->value == 0)
return NULL;
beint64_t be64 = cpu_to_be64(asset->value);
val[0] = 0x01;
memcpy(val + 1, &be64, sizeof(be64));
return val;
}
struct amount_msat fromwire_amount_msat(const u8 **cursor, size_t *max) struct amount_msat fromwire_amount_msat(const u8 **cursor, size_t *max)
{ {
struct amount_msat msat; struct amount_msat msat;

9
common/amount.h

@ -112,6 +112,15 @@ bool amount_msat_eq_sat(struct amount_msat msat, struct amount_sat sat);
* current chain. */ * current chain. */
bool amount_asset_is_main(struct amount_asset *asset); bool amount_asset_is_main(struct amount_asset *asset);
/* Convert an amount_sat to an amount_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat, const u8 *asset);
/* amount_asset_extract_value -Prefix the amount_asset's value
* to have the 'explicit' marker. Returns NULL if the
* asset was originally blinded.
* FIXME: pass through blinded amounts */
u8 *amount_asset_extract_value(const tal_t *ctx, struct amount_asset *asset);
/* Convert from a generic asset to the fee-paying asset if possible. */ /* Convert from a generic asset to the fee-paying asset if possible. */
struct amount_sat amount_asset_to_sat(struct amount_asset *asset); struct amount_sat amount_asset_to_sat(struct amount_asset *asset);

6
common/test/run-bigsize.c

@ -13,6 +13,9 @@ static const char *reason;
#include <common/bigsize.c> #include <common/bigsize.c>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -35,6 +38,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-cryptomsg.c

@ -8,6 +8,9 @@
#include <wire/wire_io.h> #include <wire/wire_io.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -30,6 +33,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-derive_basepoints.c

@ -9,6 +9,9 @@
#include <wally_core.h> #include <wally_core.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -31,6 +34,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-features.c

@ -8,6 +8,9 @@
#include <wally_core.h> #include <wally_core.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -30,6 +33,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-gossip_rcvd_filter.c

@ -5,6 +5,9 @@
#include <stdio.h> #include <stdio.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -27,6 +30,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-ip_port_parsing.c

@ -7,6 +7,9 @@
#include <common/amount.h> #include <common/amount.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -29,6 +32,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-json_remove.c

@ -5,6 +5,9 @@
#include <wire/wire.h> #include <wire/wire.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -27,6 +30,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-key_derive.c

@ -10,6 +10,9 @@
#include "../key_derive.c" #include "../key_derive.c"
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -32,6 +35,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-lock.c

@ -9,6 +9,9 @@
#include <wire/wire.h> #include <wire/wire.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -31,6 +34,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-softref.c

@ -6,6 +6,9 @@
#include <wire/wire.h> #include <wire/wire.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -28,6 +31,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
common/test/run-sphinx.c

@ -16,6 +16,9 @@
#include <unistd.h> #include <unistd.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -44,6 +47,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
connectd/test/run-initiator-success.c

@ -12,6 +12,9 @@
#include <wire/wire.h> #include <wire/wire.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -34,6 +37,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

6
connectd/test/run-responder-success.c

@ -12,6 +12,9 @@
#include <wire/wire.h> #include <wire/wire.h>
/* AUTOGENERATED MOCKS START */ /* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_extract_value */
u8 *amount_asset_extract_value(const tal_t *ctx UNNEEDED, struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_extract_value called!\n"); abort(); }
/* Generated stub for amount_asset_is_main */ /* Generated stub for amount_asset_is_main */
bool amount_asset_is_main(struct amount_asset *asset UNNEEDED) bool amount_asset_is_main(struct amount_asset *asset UNNEEDED)
{ fprintf(stderr, "amount_asset_is_main called!\n"); abort(); } { fprintf(stderr, "amount_asset_is_main called!\n"); abort(); }
@ -34,6 +37,9 @@ bool amount_sat_greater_eq(struct amount_sat a UNNEEDED, struct amount_sat b UNN
struct amount_sat a UNNEEDED, struct amount_sat a UNNEEDED,
struct amount_sat b UNNEEDED) struct amount_sat b UNNEEDED)
{ fprintf(stderr, "amount_sat_sub called!\n"); abort(); } { fprintf(stderr, "amount_sat_sub called!\n"); abort(); }
/* Generated stub for amount_sat_to_asset */
struct amount_asset amount_sat_to_asset(struct amount_sat *sat UNNEEDED, const u8 *asset UNNEEDED)
{ fprintf(stderr, "amount_sat_to_asset called!\n"); abort(); }
/* Generated stub for amount_tx_fee */ /* Generated stub for amount_tx_fee */
struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED) struct amount_sat amount_tx_fee(u32 fee_per_kw UNNEEDED, size_t weight UNNEEDED)
{ fprintf(stderr, "amount_tx_fee called!\n"); abort(); } { fprintf(stderr, "amount_tx_fee called!\n"); abort(); }

Loading…
Cancel
Save