@@ -364,23 +364,23 @@ mod tests {
364
364
) ;
365
365
}
366
366
367
- #[ test]
368
- fn compute_tagged_hash ( ) {
369
- let unsigned_invoice_request = OfferBuilder :: new ( recipient_pubkey ( ) )
370
- . amount_msats ( 1000 )
371
- . build ( ) . unwrap ( )
372
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
373
- . payer_note ( "bar" . into ( ) )
374
- . build ( ) . unwrap ( ) ;
375
-
376
- // Simply test that we can grab the tag and merkle root exposed by the accessor
377
- // functions, then use them to succesfully compute a tagged hash.
378
- let tagged_hash = unsigned_invoice_request. as_ref ( ) ;
379
- let expected_digest = unsigned_invoice_request. as_ref ( ) . as_digest ( ) ;
380
- let tag = sha256:: Hash :: hash ( tagged_hash. tag ( ) . as_bytes ( ) ) ;
381
- let actual_digest = Message :: from_digest ( super :: tagged_hash ( tag, tagged_hash. merkle_root ( ) ) . to_byte_array ( ) ) ;
382
- assert_eq ! ( * expected_digest, actual_digest) ;
383
- }
367
+ #[ test]
368
+ fn compute_tagged_hash ( ) {
369
+ let unsigned_invoice_request = OfferBuilder :: new ( recipient_pubkey ( ) )
370
+ . amount_msats ( 1000 )
371
+ . build ( ) . unwrap ( )
372
+ . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
373
+ . payer_note ( "bar" . into ( ) )
374
+ . build ( ) . unwrap ( ) ;
375
+
376
+ // Simply test that we can grab the tag and merkle root exposed by the accessor
377
+ // functions, then use them to succesfully compute a tagged hash.
378
+ let tagged_hash = unsigned_invoice_request. as_ref ( ) ;
379
+ let expected_digest = unsigned_invoice_request. as_ref ( ) . as_digest ( ) ;
380
+ let tag = sha256:: Hash :: hash ( tagged_hash. tag ( ) . as_bytes ( ) ) ;
381
+ let actual_digest = Message :: from_digest ( super :: tagged_hash ( tag, tagged_hash. merkle_root ( ) ) . to_byte_array ( ) ) ;
382
+ assert_eq ! ( * expected_digest, actual_digest) ;
383
+ }
384
384
385
385
#[ test]
386
386
fn skips_encoding_signature_tlv_records ( ) {
0 commit comments