Skip to content

Commit 09f23a3

Browse files
committed
impl Clone on unsigned BOLT12 types
This is required for bindings as passing types from Rust to GC'd languages can't map the concept of a type that has a lifetime of the called function but instead needs to clone for safety.
1 parent 726fabe commit 09f23a3

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

lightning/src/ln/onion_payment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::prelude::*;
2626
use core::ops::Deref;
2727

2828
/// Invalid inbound onion payment.
29-
#[derive(Debug)]
29+
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
3030
pub struct InboundHTLCErr {
3131
/// BOLT 4 error code.
3232
pub err_code: u16,

lightning/src/offers/invoice.rs

+1
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ for InvoiceBuilder<'a, DerivedSigningPubkey> {
503503
///
504504
/// This is serialized as a TLV stream, which includes TLV records from the originating message. As
505505
/// such, it may include unknown, odd TLV records.
506+
#[derive(Clone)]
506507
pub struct UnsignedBolt12Invoice {
507508
bytes: Vec<u8>,
508509
contents: InvoiceContents,

lightning/src/offers/invoice_request.rs

+1
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ for InvoiceRequestBuilder<'a, 'b, DerivedPayerId, secp256k1::All> {
487487
///
488488
/// This is serialized as a TLV stream, which includes TLV records from the originating message. As
489489
/// such, it may include unknown, odd TLV records.
490+
#[derive(Clone)]
490491
pub struct UnsignedInvoiceRequest {
491492
bytes: Vec<u8>,
492493
contents: InvoiceRequestContents,

0 commit comments

Comments
 (0)