Merge rust-bitcoin/rust-bitcoin#3946: Fix mutants in units
420e8c043e
Fix mutants in units (Jamil Lambert, PhD) Pull request description: Cargo mutant found missed mutants in the bitcoin constants in both signed and unsigned amounts. Add a test to check their values. ACKs for top commit: tcharding: ACK420e8c043e
apoelstra: ACK 420e8c043e34817fa51939c0484ed77cb972ad46; successfully ran local tests; sure, this is reasonable enough Tree-SHA512: 7a3834b9ac8a6c4742405d67e7a5d5b4eecdb6ec262d7525ba9538201c84fd4aef1a900c43a7dfc041cc09741dfc6fa34e7664ae371b66e9554718af0a85083b
This commit is contained in:
commit
94b40902d4
|
@ -1230,3 +1230,12 @@ fn signed_sub_assign() {
|
|||
f -= &ssat(2);
|
||||
assert_eq!(f, ssat(1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_const() {
|
||||
assert_eq!(SignedAmount::ONE_BTC.to_sat(), 100_000_000);
|
||||
assert_eq!(Amount::ONE_BTC.to_sat(), 100_000_000);
|
||||
assert_eq!(SignedAmount::FIFTY_BTC.to_sat(), SignedAmount::ONE_BTC.to_sat() * 50);
|
||||
assert_eq!(Amount::FIFTY_BTC.to_sat(), Amount::ONE_BTC.to_sat() * 50);
|
||||
assert_eq!(Amount::MAX_MONEY.to_sat() as i64, SignedAmount::MAX_MONEY.to_sat());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue