Skip to content

Commit fa9c21f

Browse files
committed
transaction: tests: deserialize ELIP203 test vectors
1 parent 2d94f5d commit fa9c21f

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/transaction.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,4 +2519,16 @@ mod tests {
25192519
assert_eq!(tx.discount_weight(), 2034);
25202520
assert_eq!(tx.discount_vsize(), 509);
25212521
}
2522+
2523+
#[test]
2524+
fn elip203() {
2525+
// Check that rust-elements can deserialize tests vector from ELIP203
2526+
// from
2527+
// https://github.com/ElementsProject/ELIPs/blob/main/elip-0203.mediawiki
2528+
let tx3: Transaction = hex_deserialize!(include_str!("../tests/data/elip203_3.hex"));
2529+
let tx4: Transaction = hex_deserialize!(include_str!("../tests/data/elip203_4.hex"));
2530+
let max_money = 21_000_000_000_000_00;
2531+
assert!(tx3.input[0].asset_issuance.amount.explicit().unwrap() > max_money);
2532+
assert!(tx4.input[0].asset_issuance.inflation_keys.explicit().unwrap() > max_money);
2533+
}
25222534
}

0 commit comments

Comments
 (0)