@@ -320,7 +320,7 @@ macro_rules! invoice_derived_signing_pubkey_builder_methods { (
320
320
#[ cfg( not( c_bindings) ) ]
321
321
let unsigned_invoice = UnsignedBolt12Invoice :: new( invreq_bytes, invoice) ;
322
322
#[ cfg( c_bindings) ]
323
- let unsigned_invoice = UnsignedBolt12Invoice :: new( invreq_bytes, invoice. clone( ) ) ;
323
+ let mut unsigned_invoice = UnsignedBolt12Invoice :: new( invreq_bytes, invoice. clone( ) ) ;
324
324
325
325
let invoice = unsigned_invoice
326
326
. sign:: <_, Infallible >(
@@ -547,18 +547,33 @@ macro_rules! unsigned_invoice_sign_method { ($self: ident, $self_type: ty $(, $s
547
547
signature_tlv_stream. write( & mut $self. bytes) . unwrap( ) ;
548
548
549
549
Ok ( Bolt12Invoice {
550
+ #[ cfg( not( c_bindings) ) ]
550
551
bytes: $self. bytes,
552
+ #[ cfg( c_bindings) ]
553
+ bytes: $self. bytes. clone( ) ,
554
+ #[ cfg( not( c_bindings) ) ]
551
555
contents: $self. contents,
556
+ #[ cfg( c_bindings) ]
557
+ contents: $self. contents. clone( ) ,
552
558
signature,
559
+ #[ cfg( not( c_bindings) ) ]
553
560
tagged_hash: $self. tagged_hash,
561
+ #[ cfg( c_bindings) ]
562
+ tagged_hash: $self. tagged_hash. clone( ) ,
554
563
} )
555
564
}
556
565
} }
557
566
567
+ #[ cfg( not( c_bindings) ) ]
558
568
impl UnsignedBolt12Invoice {
559
569
unsigned_invoice_sign_method ! ( self , Self , mut ) ;
560
570
}
561
571
572
+ #[ cfg( c_bindings) ]
573
+ impl UnsignedBolt12Invoice {
574
+ unsigned_invoice_sign_method ! ( self , & mut Self ) ;
575
+ }
576
+
562
577
impl AsRef < TaggedHash > for UnsignedBolt12Invoice {
563
578
fn as_ref ( & self ) -> & TaggedHash {
564
579
& self . tagged_hash
@@ -1508,6 +1523,8 @@ mod tests {
1508
1523
} ,
1509
1524
}
1510
1525
1526
+ #[ cfg( c_bindings) ]
1527
+ let mut unsigned_invoice = unsigned_invoice;
1511
1528
let invoice = unsigned_invoice. sign ( recipient_sign) . unwrap ( ) ;
1512
1529
1513
1530
let mut buffer = Vec :: new ( ) ;
0 commit comments