Skip to content

Commit

Permalink
Replace spaces with tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
jkczyz committed Aug 20, 2024
1 parent 55c6c56 commit bd1f319
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions lightning/src/offers/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,23 +356,23 @@ mod tests {
);
}

#[test]
fn compute_tagged_hash() {
let unsigned_invoice_request = OfferBuilder::new(recipient_pubkey())
.amount_msats(1000)
.build().unwrap()
.request_invoice(vec![1; 32], payer_pubkey()).unwrap()
.payer_note("bar".into())
.build().unwrap();

// Simply test that we can grab the tag and merkle root exposed by the accessor
// functions, then use them to succesfully compute a tagged hash.
let tagged_hash = unsigned_invoice_request.as_ref();
let expected_digest = unsigned_invoice_request.as_ref().as_digest();
let tag = sha256::Hash::hash(tagged_hash.tag().as_bytes());
let actual_digest = Message::from_digest(super::tagged_hash(tag, tagged_hash.merkle_root()).to_byte_array());
assert_eq!(*expected_digest, actual_digest);
}
#[test]
fn compute_tagged_hash() {
let unsigned_invoice_request = OfferBuilder::new(recipient_pubkey())
.amount_msats(1000)
.build().unwrap()
.request_invoice(vec![1; 32], payer_pubkey()).unwrap()
.payer_note("bar".into())
.build().unwrap();

// Simply test that we can grab the tag and merkle root exposed by the accessor
// functions, then use them to succesfully compute a tagged hash.
let tagged_hash = unsigned_invoice_request.as_ref();
let expected_digest = unsigned_invoice_request.as_ref().as_digest();
let tag = sha256::Hash::hash(tagged_hash.tag().as_bytes());
let actual_digest = Message::from_digest(super::tagged_hash(tag, tagged_hash.merkle_root()).to_byte_array());
assert_eq!(*expected_digest, actual_digest);
}

#[test]
fn skips_encoding_signature_tlv_records() {
Expand Down

0 comments on commit bd1f319

Please sign in to comment.