We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b249170 commit c44ce2bCopy full SHA for c44ce2b
packages/std/src/coins.rs
@@ -526,4 +526,15 @@ mod tests {
526
// can still use the coins afterwards
527
assert_eq!(coins.amount_of("uatom"), Uint256::new(12345));
528
}
529
+
530
+ #[test]
531
+ fn contains_only_works() {
532
+ // doctests copied here because coverage does not work for doctests
533
+ let coins: Coins = [coin(100, "uatom")].try_into().unwrap();
534
+ assert_eq!(coins.contains_only("uatom").unwrap(), Uint256::new(100));
535
+ assert_eq!(coins.contains_only("uluna"), None);
536
537
+ let coins: Coins = [coin(100, "uatom"), coin(200, "uusd")].try_into().unwrap();
538
+ assert_eq!(coins.contains_only("uatom"), None);
539
+ }
540
0 commit comments