Skip to content

Commit 50d3156

Browse files
committed
f - s/node_id/signing_pubkey
1 parent 5145c07 commit 50d3156

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lightning/src/offers/offer.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ pub struct OfferBuilder {
7777
}
7878

7979
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 {
8283
let offer = OfferContents {
8384
chains: None, metadata: None, amount: None, description, features: None,
8485
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),
8687
};
8788
OfferBuilder { offer }
8889
}
@@ -368,7 +369,7 @@ impl OfferContents {
368369
issuer: self.issuer.as_ref(),
369370
quantity_min: self.quantity_min,
370371
quantity_max: self.quantity_max,
371-
node_id: self.node_id.as_ref(),
372+
node_id: self.signing_pubkey.as_ref(),
372373
}
373374
}
374375
}
@@ -454,7 +455,7 @@ mod tests {
454455
assert_eq!(offer.issuer(), None);
455456
assert_eq!(offer.quantity_min(), 1);
456457
assert_eq!(offer.quantity_max(), 1);
457-
assert_eq!(offer.node_id(), pubkey(42));
458+
assert_eq!(offer.signing_pubkey(), pubkey(42));
458459

459460
assert_eq!(tlv_stream.chains, None);
460461
assert_eq!(tlv_stream.metadata, None);
@@ -611,7 +612,7 @@ mod tests {
611612
.build();
612613
let tlv_stream = offer.as_tlv_stream();
613614
assert_eq!(offer.paths(), Some(&paths));
614-
assert_eq!(offer.node_id(), pubkey(42));
615+
assert_eq!(offer.signing_pubkey(), pubkey(42));
615616
assert_ne!(pubkey(42), pubkey(44));
616617
assert_eq!(tlv_stream.paths, Some(&paths));
617618
assert_eq!(tlv_stream.node_id, Some(&pubkey(42)));

0 commit comments

Comments
 (0)