//! Data structures and encoding for `invoice_request_metadata` records.
+use crate::offers::signer::Metadata;
use crate::util::ser::WithoutLength;
+#[allow(unused_imports)]
use crate::prelude::*;
/// An unpredictable sequence of bytes typically containing information needed to derive
///
/// [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
#[derive(Clone, Debug)]
-pub(super) struct PayerContents(pub Vec<u8>);
+#[cfg_attr(test, derive(PartialEq))]
+pub(super) struct PayerContents(pub Metadata);
+
+/// TLV record type for [`InvoiceRequest::payer_metadata`] and [`Refund::payer_metadata`].
+///
+/// [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata
+/// [`Refund::payer_metadata`]: crate::offers::refund::Refund::payer_metadata
+pub(super) const PAYER_METADATA_TYPE: u64 = 0;
tlv_stream!(PayerTlvStream, PayerTlvStreamRef, 0..1, {
- (0, metadata: (Vec<u8>, WithoutLength)),
+ (PAYER_METADATA_TYPE, metadata: (Vec<u8>, WithoutLength)),
});