| 10 | #include <plugins/offers_offer.h> |
| 11 | |
| 12 | static bool msat_or_any(const char *buffer, |
| 13 | const jsmntok_t *tok, |
| 14 | struct tlv_offer *offer) |
| 15 | { |
| 16 | struct amount_msat msat; |
| 17 | if (json_tok_streq(buffer, tok, "any")) |
| 18 | return true; |
| 19 | |
| 20 | if (!parse_amount_msat(&msat, |
| 21 | buffer + tok->start, tok->end - tok->start)) |
| 22 | return false; |
| 23 | |
| 24 | offer->amount = tal_dup(offer, u64, |
| 25 | &msat.millisatoshis); /* Raw: other currencies */ |
| 26 | return true; |
| 27 | } |
| 28 | |
| 29 | static struct command_result *param_msat_or_any(struct command *cmd, |
| 30 | const char *name, |
no test coverage detected