@@ -870,7 +870,7 @@ mod tests {
870
870
let payment_paths = payment_paths ( ) ;
871
871
let payment_hash = payment_hash ( ) ;
872
872
let now = now ( ) ;
873
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
873
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
874
874
. amount_msats ( 1000 )
875
875
. build ( ) . unwrap ( )
876
876
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1052,7 +1052,7 @@ mod tests {
1052
1052
let now = now ( ) ;
1053
1053
let one_hour = Duration :: from_secs ( 3600 ) ;
1054
1054
1055
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1055
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1056
1056
. amount_msats ( 1000 )
1057
1057
. build ( ) . unwrap ( )
1058
1058
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1068,7 +1068,7 @@ mod tests {
1068
1068
assert_eq ! ( invoice. relative_expiry( ) , one_hour) ;
1069
1069
assert_eq ! ( tlv_stream. relative_expiry, Some ( one_hour. as_secs( ) as u32 ) ) ;
1070
1070
1071
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1071
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1072
1072
. amount_msats ( 1000 )
1073
1073
. build ( ) . unwrap ( )
1074
1074
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1087,7 +1087,7 @@ mod tests {
1087
1087
1088
1088
#[ test]
1089
1089
fn builds_invoice_with_amount_from_request ( ) {
1090
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1090
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1091
1091
. amount_msats ( 1000 )
1092
1092
. build ( ) . unwrap ( )
1093
1093
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1109,7 +1109,7 @@ mod tests {
1109
1109
let x_only_pubkey = XOnlyPublicKey :: from_keypair ( & recipient_keys ( ) ) . 0 ;
1110
1110
let tweaked_pubkey = TweakedPublicKey :: dangerous_assume_tweaked ( x_only_pubkey) ;
1111
1111
1112
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1112
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1113
1113
. amount_msats ( 1000 )
1114
1114
. build ( ) . unwrap ( )
1115
1115
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1154,7 +1154,7 @@ mod tests {
1154
1154
let mut features = Bolt12InvoiceFeatures :: empty ( ) ;
1155
1155
features. set_basic_mpp_optional ( ) ;
1156
1156
1157
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1157
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1158
1158
. amount_msats ( 1000 )
1159
1159
. build ( ) . unwrap ( )
1160
1160
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1171,7 +1171,7 @@ mod tests {
1171
1171
1172
1172
#[ test]
1173
1173
fn fails_signing_invoice ( ) {
1174
- match OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1174
+ match OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1175
1175
. amount_msats ( 1000 )
1176
1176
. build ( ) . unwrap ( )
1177
1177
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1185,7 +1185,7 @@ mod tests {
1185
1185
Err ( e) => assert_eq ! ( e, SignError :: Signing ( ( ) ) ) ,
1186
1186
}
1187
1187
1188
- match OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1188
+ match OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1189
1189
. amount_msats ( 1000 )
1190
1190
. build ( ) . unwrap ( )
1191
1191
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1202,7 +1202,7 @@ mod tests {
1202
1202
1203
1203
#[ test]
1204
1204
fn parses_invoice_with_payment_paths ( ) {
1205
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1205
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1206
1206
. amount_msats ( 1000 )
1207
1207
. build ( ) . unwrap ( )
1208
1208
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1257,7 +1257,7 @@ mod tests {
1257
1257
1258
1258
#[ test]
1259
1259
fn parses_invoice_with_created_at ( ) {
1260
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1260
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1261
1261
. amount_msats ( 1000 )
1262
1262
. build ( ) . unwrap ( )
1263
1263
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1287,7 +1287,7 @@ mod tests {
1287
1287
1288
1288
#[ test]
1289
1289
fn parses_invoice_with_relative_expiry ( ) {
1290
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1290
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1291
1291
. amount_msats ( 1000 )
1292
1292
. build ( ) . unwrap ( )
1293
1293
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1309,7 +1309,7 @@ mod tests {
1309
1309
1310
1310
#[ test]
1311
1311
fn parses_invoice_with_payment_hash ( ) {
1312
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1312
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1313
1313
. amount_msats ( 1000 )
1314
1314
. build ( ) . unwrap ( )
1315
1315
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1339,7 +1339,7 @@ mod tests {
1339
1339
1340
1340
#[ test]
1341
1341
fn parses_invoice_with_amount ( ) {
1342
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1342
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1343
1343
. amount_msats ( 1000 )
1344
1344
. build ( ) . unwrap ( )
1345
1345
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1367,7 +1367,7 @@ mod tests {
1367
1367
1368
1368
#[ test]
1369
1369
fn parses_invoice_with_allow_mpp ( ) {
1370
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1370
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1371
1371
. amount_msats ( 1000 )
1372
1372
. build ( ) . unwrap ( )
1373
1373
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1398,7 +1398,7 @@ mod tests {
1398
1398
let x_only_pubkey = XOnlyPublicKey :: from_keypair ( & recipient_keys ( ) ) . 0 ;
1399
1399
let tweaked_pubkey = TweakedPublicKey :: dangerous_assume_tweaked ( x_only_pubkey) ;
1400
1400
1401
- let offer = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1401
+ let offer = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1402
1402
. amount_msats ( 1000 )
1403
1403
. build ( ) . unwrap ( ) ;
1404
1404
let invoice_request = offer
@@ -1457,7 +1457,7 @@ mod tests {
1457
1457
1458
1458
#[ test]
1459
1459
fn parses_invoice_with_node_id ( ) {
1460
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1460
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1461
1461
. amount_msats ( 1000 )
1462
1462
. build ( ) . unwrap ( )
1463
1463
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1499,7 +1499,7 @@ mod tests {
1499
1499
#[ test]
1500
1500
fn fails_parsing_invoice_without_signature ( ) {
1501
1501
let mut buffer = Vec :: new ( ) ;
1502
- OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1502
+ OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1503
1503
. amount_msats ( 1000 )
1504
1504
. build ( ) . unwrap ( )
1505
1505
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1518,7 +1518,7 @@ mod tests {
1518
1518
1519
1519
#[ test]
1520
1520
fn fails_parsing_invoice_with_invalid_signature ( ) {
1521
- let mut invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1521
+ let mut invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1522
1522
. amount_msats ( 1000 )
1523
1523
. build ( ) . unwrap ( )
1524
1524
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
@@ -1543,7 +1543,7 @@ mod tests {
1543
1543
1544
1544
#[ test]
1545
1545
fn fails_parsing_invoice_with_extra_tlv_records ( ) {
1546
- let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
1546
+ let invoice = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) . into ( ) )
1547
1547
. amount_msats ( 1000 )
1548
1548
. build ( ) . unwrap ( )
1549
1549
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
0 commit comments