mirror of
https://github.com/vacp2p/minime.git
synced 2026-01-09 15:17:57 -05:00
add more calls in clone test
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
| approve | 0 | 15018 | 14715 | 31708 | 10 |
|
||||
| approveAndCall | 0 | 31201 | 0 | 93603 | 3 |
|
||||
| balanceOf | 0 | 555 | 0 | 2753 | 63 |
|
||||
| balanceOfAt | 0 | 1308 | 377 | 4027 | 54 |
|
||||
| balanceOfAt | 0 | 905 | 0 | 4027 | 78 |
|
||||
| changeController | 0 | 507 | 0 | 3558 | 10 |
|
||||
| claimTokens | 9537 | 41281 | 57154 | 57154 | 3 |
|
||||
| controller | 0 | 0 | 0 | 0 | 9 |
|
||||
@@ -15,14 +15,14 @@
|
||||
| decimals | 0 | 0 | 0 | 0 | 9 |
|
||||
| destroyTokens | 2308 | 5206 | 4310 | 9001 | 3 |
|
||||
| enableTransfers | 0 | 0 | 0 | 0 | 3 |
|
||||
| generateTokens | 0 | 16069 | 0 | 95808 | 54 |
|
||||
| generateTokens | 0 | 13996 | 0 | 95808 | 62 |
|
||||
| name | 0 | 0 | 0 | 0 | 9 |
|
||||
| parentSnapShotBlock | 0 | 0 | 0 | 0 | 10 |
|
||||
| parentToken | 0 | 0 | 0 | 0 | 10 |
|
||||
| receive | 7960 | 7979 | 7979 | 7998 | 2 |
|
||||
| symbol | 0 | 0 | 0 | 0 | 9 |
|
||||
| totalSupply | 0 | 315 | 0 | 2480 | 20 |
|
||||
| totalSupplyAt | 0 | 1349 | 0 | 3659 | 11 |
|
||||
| totalSupply | 0 | 286 | 0 | 2480 | 22 |
|
||||
| totalSupplyAt | 0 | 873 | 0 | 3659 | 17 |
|
||||
| transfer | 526 | 39282 | 50395 | 93084 | 20 |
|
||||
| transferFrom | 0 | 16837 | 3495 | 66596 | 7 |
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ ClaimTokensTest:testClaimERC20() (gas: 63740)
|
||||
ClaimTokensTest:testClaimETH() (gas: 13637)
|
||||
ClaimTokensTest:testClaimSelf() (gas: 61222)
|
||||
ClaimTokensTest:testDeployment() (gas: 26595)
|
||||
CreateCloneTokenTest:testCloneFutureSnapshot() (gas: 101250)
|
||||
CreateCloneTokenTest:testCreateCloneToken() (gas: 1853452)
|
||||
CreateCloneTokenTest:testCloneFutureSnapshot() (gas: 101280)
|
||||
CreateCloneTokenTest:testCreateCloneToken() (gas: 1853914)
|
||||
CreateCloneTokenTest:testDeployment() (gas: 26550)
|
||||
CreateCloneTokenTest:testGenerateTokens() (gas: 102079)
|
||||
CreateCloneTokenTest:testGenerateTokens() (gas: 102094)
|
||||
DestroyTokensTest:testDeployment() (gas: 26595)
|
||||
DestroyTokensTest:testDestroyTokens() (gas: 13501)
|
||||
DestroyTokensTest:testDestroyTokensNotEnoughBalance() (gas: 9666)
|
||||
|
||||
@@ -756,6 +756,7 @@ contract CreateCloneTokenTest is MiniMeTokenTest {
|
||||
vm.roll(secondNextBlock);
|
||||
_generateTokens(accounts[2], 5);
|
||||
vm.resumeGasMetering();
|
||||
vm.prank(deployer);
|
||||
MiniMeToken clone = _createClone();
|
||||
vm.pauseGasMetering();
|
||||
assertEq(address(clone.parentToken()), address(minimeToken), "parent token should be correct");
|
||||
@@ -797,6 +798,81 @@ contract CreateCloneTokenTest is MiniMeTokenTest {
|
||||
5,
|
||||
"balance of account 2 at second next block should be correct"
|
||||
);
|
||||
|
||||
vm.startPrank(deployer);
|
||||
clone.generateTokens(accounts[0], 5);
|
||||
clone.generateTokens(accounts[1], 5);
|
||||
clone.generateTokens(accounts[2], 5);
|
||||
clone.generateTokens(accounts[3], 5);
|
||||
assertEq(clone.totalSupply(), 35, "total supply should be correct");
|
||||
|
||||
uint256 thirdNextBlock = block.number + 3;
|
||||
vm.roll(thirdNextBlock);
|
||||
|
||||
clone.generateTokens(accounts[0], 5);
|
||||
clone.generateTokens(accounts[1], 5);
|
||||
clone.generateTokens(accounts[2], 5);
|
||||
clone.generateTokens(accounts[3], 5);
|
||||
|
||||
assertEq(clone.totalSupply(), 55, "total supply should be correct");
|
||||
assertEq(clone.totalSupplyAt(currentBlock - 1), 0, "total supply at current block-1 should be correct");
|
||||
assertEq(clone.totalSupplyAt(currentBlock), 7, "total supply at current block should be correct");
|
||||
assertEq(clone.totalSupplyAt(thirdNextBlock), 55, "total supply at thirdNextBlock should be correct");
|
||||
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[0], currentBlock - 1),
|
||||
0,
|
||||
"balance of account 0 at current block-1 should be correct"
|
||||
);
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[1], currentBlock - 1),
|
||||
0,
|
||||
"balance of account 1 at current block-1 should be correct"
|
||||
);
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[2], currentBlock - 1),
|
||||
0,
|
||||
"balance of account 2 at current block-1 should be correct"
|
||||
);
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[3], currentBlock - 1),
|
||||
0,
|
||||
"balance of account 3 at current block-1 should be correct"
|
||||
);
|
||||
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[0], currentBlock), 7, "balance of account 0 at current block should be correct"
|
||||
);
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[1], currentBlock), 0, "balance of account 1 at current block should be correct"
|
||||
);
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[2], currentBlock), 0, "balance of account 2 at current block should be correct"
|
||||
);
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[3], currentBlock), 0, "balance of account 3 at current block should be correct"
|
||||
);
|
||||
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[0], thirdNextBlock),
|
||||
17,
|
||||
"balance of account 0 at third next block should be correct"
|
||||
);
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[1], thirdNextBlock),
|
||||
13,
|
||||
"balance of account 1 at third next block should be correct"
|
||||
);
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[2], thirdNextBlock),
|
||||
15,
|
||||
"balance of account 2 at third next block should be correct"
|
||||
);
|
||||
assertEq(
|
||||
clone.balanceOfAt(accounts[3], thirdNextBlock),
|
||||
10,
|
||||
"balance of account 3 at third next block should be correct"
|
||||
);
|
||||
vm.resumeGasMetering();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user