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