Skip to content

Commit d41f4ef

Browse files
committed
Merge #264: transaction: tests: deserialize ELIP203 test vectors
846ec64 transaction: tests: deserialize ELIP203 test vectors (Leonardo Comandini) Pull request description: ACKs for top commit: delta1: ACK 846ec64; ran tests locally apoelstra: ACK 846ec64; successfully ran local tests Tree-SHA512: 02c70efe534344a399e71ef3f4552430428fadfe0db85dbf43440a742faa251b6b99daa531db8171660f77e86124603f7ab3238569c5f278feba267083415f10
2 parents 2d94f5d + 846ec64 commit d41f4ef

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 = 2_100_000_000_000_000;
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)