49
49
//! let payment_id = PaymentId([1; 32]);
50
50
//! let mut buffer = Vec::new();
51
51
//!
52
- //! # use lightning::offers::invoice_request::{DerivedPayerSigningPubkey, InvoiceRequestBuilder} ;
53
- //! # <InvoiceRequestBuilder<DerivedPayerSigningPubkey, _>>::from(
52
+ //! # use lightning::offers::invoice_request::InvoiceRequestBuilder;
53
+ //! # <InvoiceRequestBuilder<_>>::from(
54
54
//! "lno1qcp4256ypq"
55
55
//! .parse::<Offer>()?
56
56
//! .request_invoice(&expanded_key, nonce, &secp_ctx, payment_id)?
@@ -111,11 +111,10 @@ pub(super) const IV_BYTES: &[u8; IV_LEN] = b"LDK Invreq ~~~~~";
111
111
/// This is not exported to bindings users as builder patterns don't map outside of move semantics.
112
112
///
113
113
/// [module-level documentation]: self
114
- pub struct InvoiceRequestBuilder < ' a , ' b , P : PayerSigningPubkeyStrategy , T : secp256k1:: Signing > {
114
+ pub struct InvoiceRequestBuilder < ' a , ' b , T : secp256k1:: Signing > {
115
115
offer : & ' a Offer ,
116
116
invoice_request : InvoiceRequestContentsWithoutPayerSigningPubkey ,
117
117
payer_signing_pubkey : Option < PublicKey > ,
118
- payer_signing_pubkey_strategy : core:: marker:: PhantomData < P > ,
119
118
secp_ctx : Option < & ' b Secp256k1 < T > > ,
120
119
}
121
120
@@ -129,22 +128,9 @@ pub struct InvoiceRequestWithDerivedPayerSigningPubkeyBuilder<'a, 'b> {
129
128
offer : & ' a Offer ,
130
129
invoice_request : InvoiceRequestContentsWithoutPayerSigningPubkey ,
131
130
payer_signing_pubkey : Option < PublicKey > ,
132
- payer_signing_pubkey_strategy : core:: marker:: PhantomData < DerivedPayerSigningPubkey > ,
133
131
secp_ctx : Option < & ' b Secp256k1 < secp256k1:: All > > ,
134
132
}
135
133
136
- /// Indicates how [`InvoiceRequest::payer_signing_pubkey`] will be set.
137
- ///
138
- /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
139
- pub trait PayerSigningPubkeyStrategy { }
140
-
141
- /// [`InvoiceRequest::payer_signing_pubkey`] will be derived.
142
- ///
143
- /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
144
- pub struct DerivedPayerSigningPubkey { }
145
-
146
- impl PayerSigningPubkeyStrategy for DerivedPayerSigningPubkey { }
147
-
148
134
macro_rules! invoice_request_derived_payer_signing_pubkey_builder_methods { (
149
135
$self: ident, $self_type: ty, $secp_context: ty
150
136
) => {
@@ -160,7 +146,6 @@ macro_rules! invoice_request_derived_payer_signing_pubkey_builder_methods { (
160
146
offer,
161
147
invoice_request: Self :: create_contents( offer, metadata) ,
162
148
payer_signing_pubkey: None ,
163
- payer_signing_pubkey_strategy: core:: marker:: PhantomData ,
164
149
secp_ctx: Some ( secp_ctx) ,
165
150
}
166
151
}
@@ -397,11 +382,8 @@ macro_rules! invoice_request_builder_test_methods { (
397
382
}
398
383
} }
399
384
400
- impl < ' a , ' b , T : secp256k1:: Signing > InvoiceRequestBuilder < ' a , ' b , DerivedPayerSigningPubkey , T > {
385
+ impl < ' a , ' b , T : secp256k1:: Signing > InvoiceRequestBuilder < ' a , ' b , T > {
401
386
invoice_request_derived_payer_signing_pubkey_builder_methods ! ( self , Self , T ) ;
402
- }
403
-
404
- impl < ' a , ' b , P : PayerSigningPubkeyStrategy , T : secp256k1:: Signing > InvoiceRequestBuilder < ' a , ' b , P , T > {
405
387
invoice_request_builder_methods ! ( self , Self , Self , self , T , mut ) ;
406
388
407
389
#[ cfg( test) ]
@@ -423,14 +405,14 @@ impl<'a, 'b> InvoiceRequestWithDerivedPayerSigningPubkeyBuilder<'a, 'b> {
423
405
424
406
#[ cfg( c_bindings) ]
425
407
impl < ' a , ' b > From < InvoiceRequestWithDerivedPayerSigningPubkeyBuilder < ' a , ' b > >
426
- for InvoiceRequestBuilder < ' a , ' b , DerivedPayerSigningPubkey , secp256k1:: All > {
408
+ for InvoiceRequestBuilder < ' a , ' b , secp256k1:: All > {
427
409
fn from ( builder : InvoiceRequestWithDerivedPayerSigningPubkeyBuilder < ' a , ' b > ) -> Self {
428
410
let InvoiceRequestWithDerivedPayerSigningPubkeyBuilder {
429
- offer, invoice_request, payer_signing_pubkey, payer_signing_pubkey_strategy , secp_ctx,
411
+ offer, invoice_request, payer_signing_pubkey, secp_ctx,
430
412
} = builder;
431
413
432
414
Self {
433
- offer, invoice_request, payer_signing_pubkey, payer_signing_pubkey_strategy , secp_ctx,
415
+ offer, invoice_request, payer_signing_pubkey, secp_ctx,
434
416
}
435
417
}
436
418
}
0 commit comments