Skip to content

Commit

Permalink
Merge #220: tx: discountct: add missing testcase from #204
Browse files Browse the repository at this point in the history
66110dc tx: discountct: add missing testcase from #204 (Pablo Greco)

Pull request description:

  In #204 we included a lot of files for discountCT test cases, but one of the files was never tested (2in3out_tx.hex). This is just the testing of that file.

ACKs for top commit:
  apoelstra:
    ACK 66110dc; successfully ran local tests

Tree-SHA512: 8aba1ce9ed824187246c01783ace9498ff7ad9e6690ac7cacb5e40d676232fef2e551dabff3d964678ef28f890a835809dcd5c3f6c0d769cbdab7cd0f639d5e8
  • Loading branch information
apoelstra committed Feb 14, 2025
2 parents 0ea307a + 66110dc commit 03426a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2471,6 +2471,14 @@ mod tests {
assert_eq!(tx.discount_weight(), 1302);
assert_eq!(tx.discount_vsize(), 326);

let tx: Transaction = hex_deserialize!(include_str!("../tests/data/2in3out_tx.hex"));
assert_eq!(tx.input.len(), 2);
assert_eq!(tx.output.len(), 3);
assert_eq!(tx.weight(), 10300);
assert_eq!(tx.vsize(), 2575);
assert_eq!(tx.discount_weight(), 1302);
assert_eq!(tx.discount_vsize(), 326);

let tx: Transaction = hex_deserialize!(include_str!("../tests/data/2in3out_tx2.hex"));
assert_eq!(tx.input.len(), 2);
assert_eq!(tx.output.len(), 3);
Expand Down

0 comments on commit 03426a6

Please sign in to comment.