Skip to content

Commit 6964e1b

Browse files
committed
..Default::default()
1 parent 338519a commit 6964e1b

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

crates/lni/cln/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ mod tests {
166166
.create_invoice(CreateInvoiceParams {
167167
invoice_type: InvoiceType::Bolt11,
168168
amount_msats: Some(amount_msats),
169-
offer: None,
170169
description: Some(description.clone()),
171170
description_hash: Some(description_hash.clone()),
172171
expiry: Some(expiry),
172+
..Default::default()
173173
})
174174
.await
175175
{
@@ -189,11 +189,8 @@ mod tests {
189189
match NODE
190190
.create_invoice(CreateInvoiceParams {
191191
invoice_type: InvoiceType::Bolt11,
192-
amount_msats: None,
193-
offer: None,
194-
description: None,
195-
description_hash: None,
196192
expiry: Some(expiry),
193+
..Default::default()
197194
})
198195
.await
199196
{

crates/lni/types.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,18 @@ pub struct CreateInvoiceParams {
218218
pub description_hash: Option<String>,
219219
pub expiry: Option<i64>,
220220
}
221+
impl Default for CreateInvoiceParams {
222+
fn default() -> Self {
223+
Self {
224+
invoice_type: InvoiceType::Bolt11,
225+
amount_msats: None,
226+
offer: None,
227+
description: None,
228+
description_hash: None,
229+
expiry: None,
230+
}
231+
}
232+
}
221233

222234
// Pay Code aka BOLT12 Offer
223235
#[cfg_attr(feature = "napi_rs", napi(object))]

0 commit comments

Comments
 (0)