@@ -346,16 +346,16 @@ impl<'a, 'b, P: PayerIdStrategy, T: secp256k1::Signing> InvoiceRequestBuilder<'a
346346/// A semantically valid [`InvoiceRequest`] that hasn't been signed.
347347pub struct UnsignedInvoiceRequest {
348348 bytes : Vec < u8 > ,
349- invoice_request : InvoiceRequestContents ,
349+ contents : InvoiceRequestContents ,
350350 tagged_hash : TaggedHash ,
351351}
352352
353353impl UnsignedInvoiceRequest {
354- fn new ( offer : & Offer , invoice_request : InvoiceRequestContents ) -> Self {
354+ fn new ( offer : & Offer , contents : InvoiceRequestContents ) -> Self {
355355 // Use the offer bytes instead of the offer TLV stream as the offer may have contained
356356 // unknown TLV records, which are not stored in `OfferContents`.
357357 let ( payer_tlv_stream, _offer_tlv_stream, invoice_request_tlv_stream) =
358- invoice_request . as_tlv_stream ( ) ;
358+ contents . as_tlv_stream ( ) ;
359359 let offer_bytes = WithoutLength ( & offer. bytes ) ;
360360 let unsigned_tlv_stream = ( payer_tlv_stream, offer_bytes, invoice_request_tlv_stream) ;
361361
@@ -364,7 +364,7 @@ impl UnsignedInvoiceRequest {
364364
365365 let tagged_hash = TaggedHash :: new ( SIGNATURE_TAG , & bytes) ;
366366
367- Self { bytes, invoice_request , tagged_hash }
367+ Self { bytes, contents , tagged_hash }
368368 }
369369
370370 /// Signs the invoice request using the given function.
@@ -374,7 +374,7 @@ impl UnsignedInvoiceRequest {
374374 where
375375 F : FnOnce ( & Self ) -> Result < Signature , E >
376376 {
377- let pubkey = self . invoice_request . payer_id ;
377+ let pubkey = self . contents . payer_id ;
378378 let signature = merkle:: sign_message ( sign, & self , pubkey) ?;
379379
380380 // Append the signature TLV record to the bytes.
@@ -385,7 +385,7 @@ impl UnsignedInvoiceRequest {
385385
386386 Ok ( InvoiceRequest {
387387 bytes : self . bytes ,
388- contents : self . invoice_request ,
388+ contents : self . contents ,
389389 signature,
390390 } )
391391 }
@@ -1681,7 +1681,7 @@ mod tests {
16811681 . build ( ) . unwrap ( ) ;
16821682 let unsigned_invoice_request = offer. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
16831683 . build ( ) . unwrap ( ) ;
1684- let mut tlv_stream = unsigned_invoice_request. invoice_request . as_tlv_stream ( ) ;
1684+ let mut tlv_stream = unsigned_invoice_request. contents . as_tlv_stream ( ) ;
16851685 tlv_stream. 0 . metadata = None ;
16861686
16871687 let mut buffer = Vec :: new ( ) ;
@@ -1702,7 +1702,7 @@ mod tests {
17021702 . build ( ) . unwrap ( ) ;
17031703 let unsigned_invoice_request = offer. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
17041704 . build ( ) . unwrap ( ) ;
1705- let mut tlv_stream = unsigned_invoice_request. invoice_request . as_tlv_stream ( ) ;
1705+ let mut tlv_stream = unsigned_invoice_request. contents . as_tlv_stream ( ) ;
17061706 tlv_stream. 2 . payer_id = None ;
17071707
17081708 let mut buffer = Vec :: new ( ) ;
@@ -1721,7 +1721,7 @@ mod tests {
17211721 . build ( ) . unwrap ( ) ;
17221722 let unsigned_invoice_request = offer. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
17231723 . build ( ) . unwrap ( ) ;
1724- let mut tlv_stream = unsigned_invoice_request. invoice_request . as_tlv_stream ( ) ;
1724+ let mut tlv_stream = unsigned_invoice_request. contents . as_tlv_stream ( ) ;
17251725 tlv_stream. 1 . node_id = None ;
17261726
17271727 let mut buffer = Vec :: new ( ) ;
@@ -1743,7 +1743,7 @@ mod tests {
17431743 . build ( ) . unwrap ( )
17441744 . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
17451745 . build ( ) . unwrap ( )
1746- . invoice_request
1746+ . contents
17471747 . write ( & mut buffer) . unwrap ( ) ;
17481748
17491749 match InvoiceRequest :: try_from ( buffer) {
0 commit comments