@@ -877,13 +877,12 @@ impl VerifiedInvoiceRequest {
877
877
let InvoiceRequestContents {
878
878
payer_id,
879
879
inner : InvoiceRequestContentsWithoutPayerId {
880
- payer : _, offer : _, chain : _, amount_msats, features, quantity, payer_note
880
+ payer : _, offer : _, chain : _, amount_msats : _ , features, quantity, payer_note
881
881
} ,
882
882
} = & self . inner . contents ;
883
883
884
884
InvoiceRequestFields {
885
885
payer_id : * payer_id,
886
- amount_msats : * amount_msats,
887
886
features : features. clone ( ) ,
888
887
quantity : * quantity,
889
888
payer_note_truncated : payer_note. clone ( )
@@ -1126,12 +1125,6 @@ pub struct InvoiceRequestFields {
1126
1125
/// A possibly transient pubkey used to sign the invoice request.
1127
1126
pub payer_id : PublicKey ,
1128
1127
1129
- /// The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
1130
- /// must be greater than or equal to [`Offer::amount`], converted if necessary.
1131
- ///
1132
- /// [`chain`]: InvoiceRequest::chain
1133
- pub amount_msats : Option < u64 > ,
1134
-
1135
1128
/// Features pertaining to requesting an invoice.
1136
1129
pub features : InvoiceRequestFeatures ,
1137
1130
@@ -1150,10 +1143,9 @@ impl Writeable for InvoiceRequestFields {
1150
1143
fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , io:: Error > {
1151
1144
write_tlv_fields ! ( writer, {
1152
1145
( 0 , self . payer_id, required) ,
1153
- ( 2 , self . amount_msats. map( |v| HighZeroBytesDroppedBigSize ( v) ) , option) ,
1154
- ( 4 , WithoutLength ( & self . features) , required) ,
1155
- ( 6 , self . quantity. map( |v| HighZeroBytesDroppedBigSize ( v) ) , option) ,
1156
- ( 8 , self . payer_note_truncated. as_ref( ) . map( |s| WithoutLength ( & s. 0 ) ) , option) ,
1146
+ ( 2 , WithoutLength ( & self . features) , required) ,
1147
+ ( 4 , self . quantity. map( |v| HighZeroBytesDroppedBigSize ( v) ) , option) ,
1148
+ ( 6 , self . payer_note_truncated. as_ref( ) . map( |s| WithoutLength ( & s. 0 ) ) , option) ,
1157
1149
} ) ;
1158
1150
Ok ( ( ) )
1159
1151
}
@@ -1163,15 +1155,14 @@ impl Readable for InvoiceRequestFields {
1163
1155
fn read < R : io:: Read > ( reader : & mut R ) -> Result < Self , DecodeError > {
1164
1156
_init_and_read_len_prefixed_tlv_fields ! ( reader, {
1165
1157
( 0 , payer_id, required) ,
1166
- ( 2 , amount_msats, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
1167
- ( 4 , features, ( option, encoding: ( InvoiceRequestFeatures , WithoutLength ) ) ) ,
1168
- ( 6 , quantity, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
1169
- ( 8 , payer_note_truncated, ( option, encoding: ( String , WithoutLength ) ) ) ,
1158
+ ( 2 , features, ( option, encoding: ( InvoiceRequestFeatures , WithoutLength ) ) ) ,
1159
+ ( 4 , quantity, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
1160
+ ( 6 , payer_note_truncated, ( option, encoding: ( String , WithoutLength ) ) ) ,
1170
1161
} ) ;
1171
1162
let features = features. unwrap_or ( InvoiceRequestFeatures :: empty ( ) ) ;
1172
1163
1173
1164
Ok ( InvoiceRequestFields {
1174
- payer_id : payer_id. 0 . unwrap ( ) , amount_msats , features, quantity,
1165
+ payer_id : payer_id. 0 . unwrap ( ) , features, quantity,
1175
1166
payer_note_truncated : payer_note_truncated. map ( |s| UntrustedString ( s) ) ,
1176
1167
} )
1177
1168
}
@@ -2264,7 +2255,6 @@ mod tests {
2264
2255
2265
2256
let invoice_request = offer. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2266
2257
. chain ( Network :: Testnet ) . unwrap ( )
2267
- . amount_msats ( 1001 ) . unwrap ( )
2268
2258
. quantity ( 1 ) . unwrap ( )
2269
2259
. payer_note ( "0" . repeat ( PAYER_NOTE_LIMIT * 2 ) )
2270
2260
. build ( ) . unwrap ( )
@@ -2277,7 +2267,6 @@ mod tests {
2277
2267
fields,
2278
2268
InvoiceRequestFields {
2279
2269
payer_id: payer_pubkey( ) ,
2280
- amount_msats: Some ( 1001 ) ,
2281
2270
features: InvoiceRequestFeatures :: empty( ) ,
2282
2271
quantity: Some ( 1 ) ,
2283
2272
payer_note_truncated: Some ( UntrustedString ( "0" . repeat( PAYER_NOTE_LIMIT ) ) ) ,
0 commit comments