@@ -77,12 +77,13 @@ pub struct OfferBuilder {
77
77
}
78
78
79
79
impl OfferBuilder {
80
- /// Creates a new builder for an offer with the given description and node id.
81
- pub fn new ( description : String , node_id : PublicKey ) -> Self {
80
+ /// Creates a new builder for an offer with the given description, using the given pubkey for
81
+ /// signing invoices.
82
+ pub fn new ( description : String , signing_pubkey : PublicKey ) -> Self {
82
83
let offer = OfferContents {
83
84
chains : None , metadata : None , amount : None , description, features : None ,
84
85
absolute_expiry : None , issuer : None , paths : None , quantity_min : None ,
85
- quantity_max : None , node_id : Some ( node_id ) ,
86
+ quantity_max : None , signing_pubkey : Some ( signing_pubkey ) ,
86
87
} ;
87
88
OfferBuilder { offer }
88
89
}
@@ -368,7 +369,7 @@ impl OfferContents {
368
369
issuer : self . issuer . as_ref ( ) ,
369
370
quantity_min : self . quantity_min ,
370
371
quantity_max : self . quantity_max ,
371
- node_id : self . node_id . as_ref ( ) ,
372
+ node_id : self . signing_pubkey . as_ref ( ) ,
372
373
}
373
374
}
374
375
}
@@ -454,7 +455,7 @@ mod tests {
454
455
assert_eq ! ( offer. issuer( ) , None ) ;
455
456
assert_eq ! ( offer. quantity_min( ) , 1 ) ;
456
457
assert_eq ! ( offer. quantity_max( ) , 1 ) ;
457
- assert_eq ! ( offer. node_id ( ) , pubkey( 42 ) ) ;
458
+ assert_eq ! ( offer. signing_pubkey ( ) , pubkey( 42 ) ) ;
458
459
459
460
assert_eq ! ( tlv_stream. chains, None ) ;
460
461
assert_eq ! ( tlv_stream. metadata, None ) ;
@@ -611,7 +612,7 @@ mod tests {
611
612
. build ( ) ;
612
613
let tlv_stream = offer. as_tlv_stream ( ) ;
613
614
assert_eq ! ( offer. paths( ) , Some ( & paths) ) ;
614
- assert_eq ! ( offer. node_id ( ) , pubkey( 42 ) ) ;
615
+ assert_eq ! ( offer. signing_pubkey ( ) , pubkey( 42 ) ) ;
615
616
assert_ne ! ( pubkey( 42 ) , pubkey( 44 ) ) ;
616
617
assert_eq ! ( tlv_stream. paths, Some ( & paths) ) ;
617
618
assert_eq ! ( tlv_stream. node_id, Some ( & pubkey( 42 ) ) ) ;
0 commit comments