InvoiceRequestContentsWithoutPayerSigningPubkey {
payer: PayerContents(metadata), offer, chain: None, amount_msats: None,
features: InvoiceRequestFeatures::empty(), quantity: None, payer_note: None,
+ #[cfg(test)]
+ experimental_bar: None,
}
}
$return_value
}
+ #[cfg_attr(c_bindings, allow(dead_code))]
+ pub(super) fn experimental_bar($($self_mut)* $self: $self_type, experimental_bar: u64) -> $return_type {
+ $self.invoice_request.experimental_bar = Some(experimental_bar);
+ $return_value
+ }
+
#[cfg_attr(c_bindings, allow(dead_code))]
pub(super) fn build_unchecked($self: $self_type) -> UnsignedInvoiceRequest {
$self.build_without_checks().0
features: InvoiceRequestFeatures,
quantity: Option<u64>,
payer_note: Option<String>,
+ #[cfg(test)]
+ experimental_bar: Option<u64>,
}
macro_rules! invoice_request_accessors { ($self: ident, $contents: expr) => {
let InvoiceRequestContents {
payer_signing_pubkey,
inner: InvoiceRequestContentsWithoutPayerSigningPubkey {
- payer: _, offer: _, chain: _, amount_msats: _, features: _, quantity, payer_note
+ payer: _, offer: _, chain: _, amount_msats: _, features: _, quantity, payer_note,
+ #[cfg(test)]
+ experimental_bar: _,
},
} = &self.inner.contents;
paths: None,
};
- let experimental_invoice_request = ExperimentalInvoiceRequestTlvStreamRef {};
+ let experimental_invoice_request = ExperimentalInvoiceRequestTlvStreamRef {
+ #[cfg(test)]
+ experimental_bar: self.experimental_bar,
+ };
(payer, offer, invoice_request, experimental_offer, experimental_invoice_request)
}
pub(super) const EXPERIMENTAL_INVOICE_REQUEST_TYPES: core::ops::Range<u64> =
2_000_000_000..3_000_000_000;
+#[cfg(not(test))]
tlv_stream!(
ExperimentalInvoiceRequestTlvStream, ExperimentalInvoiceRequestTlvStreamRef,
EXPERIMENTAL_INVOICE_REQUEST_TYPES, {}
);
+#[cfg(test)]
+tlv_stream!(
+ ExperimentalInvoiceRequestTlvStream, ExperimentalInvoiceRequestTlvStreamRef,
+ EXPERIMENTAL_INVOICE_REQUEST_TYPES, {
+ (2_999_999_999, experimental_bar: (u64, HighZeroBytesDroppedBigSize)),
+ }
+);
+
type FullInvoiceRequestTlvStream = (
PayerTlvStream, OfferTlvStream, InvoiceRequestTlvStream, SignatureTlvStream,
ExperimentalOfferTlvStream, ExperimentalInvoiceRequestTlvStream,
chain, amount, features, quantity, payer_id, payer_note, paths,
},
experimental_offer_tlv_stream,
- ExperimentalInvoiceRequestTlvStream {},
+ ExperimentalInvoiceRequestTlvStream {
+ #[cfg(test)]
+ experimental_bar,
+ },
) = tlv_stream;
let payer = match metadata {
Ok(InvoiceRequestContents {
inner: InvoiceRequestContentsWithoutPayerSigningPubkey {
payer, offer, chain, amount_msats: amount, features, quantity, payer_note,
+ #[cfg(test)]
+ experimental_bar,
},
payer_signing_pubkey,
})
ExperimentalOfferTlvStreamRef {
experimental_foo: None,
},
- ExperimentalInvoiceRequestTlvStreamRef {},
+ ExperimentalInvoiceRequestTlvStreamRef {
+ experimental_bar: None,
+ },
),
);
let invoice_request = offer
.request_invoice_deriving_metadata(signing_pubkey, &expanded_key, nonce, payment_id)
.unwrap()
+ .experimental_bar(42)
.build().unwrap()
.sign(payer_sign).unwrap();
assert_eq!(invoice_request.payer_signing_pubkey(), payer_pubkey());
let invoice_request = offer
.request_invoice_deriving_signing_pubkey(&expanded_key, nonce, &secp_ctx, payment_id)
.unwrap()
+ .experimental_bar(42)
.build_and_sign()
.unwrap();
quantity: None, payer_signing_pubkey: signing_pubkey, payer_note: None, paths: None,
#[cfg(test)]
experimental_foo: None,
+ #[cfg(test)]
+ experimental_bar: None,
},
secp_ctx: None,
})
quantity: None, payer_signing_pubkey: node_id, payer_note: None, paths: None,
#[cfg(test)]
experimental_foo: None,
+ #[cfg(test)]
+ experimental_bar: None,
},
secp_ctx: Some(secp_ctx),
})
$self.refund.experimental_foo = Some(experimental_foo);
$return_value
}
+
+ #[cfg_attr(c_bindings, allow(dead_code))]
+ pub(super) fn experimental_bar($($self_mut)* $self: $self_type, experimental_bar: u64) -> $return_type {
+ $self.refund.experimental_bar = Some(experimental_bar);
+ $return_value
+ }
} }
impl<'a> RefundBuilder<'a, secp256k1::SignOnly> {
paths: Option<Vec<BlindedMessagePath>>,
#[cfg(test)]
experimental_foo: Option<u64>,
+ #[cfg(test)]
+ experimental_bar: Option<u64>,
}
impl Refund {
experimental_foo: self.experimental_foo,
};
- let experimental_invoice_request = ExperimentalInvoiceRequestTlvStreamRef {};
+ let experimental_invoice_request = ExperimentalInvoiceRequestTlvStreamRef {
+ #[cfg(test)]
+ experimental_bar: self.experimental_bar,
+ };
(payer, offer, invoice_request, experimental_offer, experimental_invoice_request)
}
#[cfg(test)]
experimental_foo,
},
- ExperimentalInvoiceRequestTlvStream {},
+ ExperimentalInvoiceRequestTlvStream {
+ #[cfg(test)]
+ experimental_bar,
+ },
) = tlv_stream;
let payer = match payer_metadata {
payer_signing_pubkey, payer_note, paths,
#[cfg(test)]
experimental_foo,
+ #[cfg(test)]
+ experimental_bar,
})
}
}
ExperimentalOfferTlvStreamRef {
experimental_foo: None,
},
- ExperimentalInvoiceRequestTlvStreamRef {},
+ ExperimentalInvoiceRequestTlvStreamRef {
+ experimental_bar: None,
+ },
),
);
::deriving_signing_pubkey(node_id, &expanded_key, nonce, &secp_ctx, 1000, payment_id)
.unwrap()
.experimental_foo(42)
+ .experimental_bar(42)
.build().unwrap();
assert_eq!(refund.payer_signing_pubkey(), node_id);
.unwrap()
.path(blinded_path)
.experimental_foo(42)
+ .experimental_bar(42)
.build().unwrap();
assert_ne!(refund.payer_signing_pubkey(), node_id);