@@ -320,7 +320,7 @@ macro_rules! invoice_derived_signing_pubkey_builder_methods { (
320320 #[ cfg( not( c_bindings) ) ]
321321 let unsigned_invoice = UnsignedBolt12Invoice :: new( invreq_bytes, invoice) ;
322322 #[ cfg( c_bindings) ]
323- let unsigned_invoice = UnsignedBolt12Invoice :: new( invreq_bytes, invoice. clone( ) ) ;
323+ let mut unsigned_invoice = UnsignedBolt12Invoice :: new( invreq_bytes, invoice. clone( ) ) ;
324324
325325 let invoice = unsigned_invoice
326326 . sign:: <_, Infallible >(
@@ -547,18 +547,33 @@ macro_rules! unsigned_invoice_sign_method { ($self: ident, $self_type: ty $(, $s
547547 signature_tlv_stream. write( & mut $self. bytes) . unwrap( ) ;
548548
549549 Ok ( Bolt12Invoice {
550+ #[ cfg( not( c_bindings) ) ]
550551 bytes: $self. bytes,
552+ #[ cfg( c_bindings) ]
553+ bytes: $self. bytes. clone( ) ,
554+ #[ cfg( not( c_bindings) ) ]
551555 contents: $self. contents,
556+ #[ cfg( c_bindings) ]
557+ contents: $self. contents. clone( ) ,
552558 signature,
559+ #[ cfg( not( c_bindings) ) ]
553560 tagged_hash: $self. tagged_hash,
561+ #[ cfg( c_bindings) ]
562+ tagged_hash: $self. tagged_hash. clone( ) ,
554563 } )
555564 }
556565} }
557566
567+ #[ cfg( not( c_bindings) ) ]
558568impl UnsignedBolt12Invoice {
559569 unsigned_invoice_sign_method ! ( self , Self , mut ) ;
560570}
561571
572+ #[ cfg( c_bindings) ]
573+ impl UnsignedBolt12Invoice {
574+ unsigned_invoice_sign_method ! ( self , & mut Self ) ;
575+ }
576+
562577impl AsRef < TaggedHash > for UnsignedBolt12Invoice {
563578 fn as_ref ( & self ) -> & TaggedHash {
564579 & self . tagged_hash
@@ -1508,6 +1523,8 @@ mod tests {
15081523 } ,
15091524 }
15101525
1526+ #[ cfg( c_bindings) ]
1527+ let mut unsigned_invoice = unsigned_invoice;
15111528 let invoice = unsigned_invoice. sign ( recipient_sign) . unwrap ( ) ;
15121529
15131530 let mut buffer = Vec :: new ( ) ;
0 commit comments