File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module MyToken::my_token_tests {
44 use 0x1 ::vector;
55 use MyToken ::coin;
66
7- // Простой «синк», чтобы не дропать ресурс coin::Coin
7+ // простой «синк», чтобы не дропать ресурс coin::Coin
88 struct Trash has key { inner: vector <coin::Coin > }
99
1010 public entry fun init_trash (acc: &signer ) {
@@ -16,6 +16,7 @@ module MyToken::my_token_tests {
1616 vector ::push_back (&mut t.inner, c);
1717 }
1818
19+ // позитив: один mint
1920 #[test(admin = @0 xA)]
2021 public entry fun test_mint_balance_ok (admin: &signer ) acquires Trash {
2122 init_trash (admin);
@@ -24,4 +25,15 @@ module MyToken::my_token_tests {
2425 sink (admin, c);
2526 }
2627
28+ // позитив: два mint’а, проверяем оба баланса отдельно
29+ #[test(admin = @0 xB)]
30+ public entry fun test_double_mint_ok (admin: &signer ) acquires Trash {
31+ init_trash (admin);
32+ let c1 = coin::mint (60 );
33+ let c2 = coin::mint (250 );
34+ assert ! (coin::balance (&c1) == 60 , 0 );
35+ assert ! (coin::balance (&c2) == 250 , 1 );
36+ sink (admin, c1);
37+ sink (admin, c2);
38+ }
2739}
You can’t perform that action at this time.
0 commit comments