BOLTs: update to more recent bolt12 spec.

It's 2b7ad577d7a790b302bd1aa044b22c809c76e49d, which reverts the
point32 changes.

It also restores send_invoice in `invoice`, which we had removed
from spec and put into the recurrence patch.

I originally had implemented compatibility, but other changes
which followed this are far too widespread.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: offers: complete rework of spec from other teams (yay!) breaks previous compatibility (boo!)
This commit is contained in:
Rusty Russell
2022-10-17 11:07:05 +10:30
parent eac8401f84
commit e30ea91908
17 changed files with 89 additions and 193 deletions

View File

@@ -136,15 +136,14 @@ static void set_recurring_inv_expiry(struct tlv_invoice *inv, u64 last_pay)
/* We rely on label forms for uniqueness. */
static void json_add_label(struct json_stream *js,
const struct sha256 *offer_id,
const struct point32 *payer_key,
const struct pubkey *payer_key,
const u32 counter)
{
char *label;
label = tal_fmt(tmpctx, "%s-%s-%u",
type_to_string(tmpctx, struct sha256, offer_id),
type_to_string(tmpctx, struct point32,
payer_key),
type_to_string(tmpctx, struct pubkey, payer_key),
counter);
json_add_string(js, "label", label);
}
@@ -425,7 +424,7 @@ static struct command_result *check_previous_invoice(struct command *cmd,
*/
static bool check_payer_sig(struct command *cmd,
const struct tlv_invoice_request *invreq,
const struct point32 *payer_key,
const struct pubkey *payer_key,
const struct bip340sig *sig)
{
struct sha256 merkle, sighash;
@@ -775,7 +774,7 @@ static struct command_result *listoffers_done(struct command *cmd,
/* FIXME: Insert paths and payinfo */
ir->inv->issuer = tal_dup_talarr(ir->inv, char, ir->offer->issuer);
ir->inv->node_id = tal_dup(ir->inv, struct point32, ir->offer->node_id);
ir->inv->node_id = tal_dup(ir->inv, struct pubkey, ir->offer->node_id);
/* BOLT-offers #12:
* - MUST set (or not set) `quantity` exactly as the invoice_request
* did.
@@ -786,7 +785,7 @@ static struct command_result *listoffers_done(struct command *cmd,
/* BOLT-offers #12:
* - MUST set `payer_key` exactly as the invoice_request did.
*/
ir->inv->payer_key = tal_dup(ir->inv, struct point32,
ir->inv->payer_key = tal_dup(ir->inv, struct pubkey,
ir->invreq->payer_key);
/* BOLT-offers #12: