mirror of
https://github.com/vacp2p/minime.git
synced 2026-01-07 22:34:03 -05:00
add testFutureParentSnapshot
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
| allowance | 0 | 62 | 0 | 808 | 13 |
|
||||
| approve | 0 | 15018 | 14715 | 31708 | 10 |
|
||||
| approveAndCall | 0 | 31201 | 0 | 93603 | 3 |
|
||||
| balanceOf | 0 | 285 | 0 | 2753 | 51 |
|
||||
| balanceOfAt | 0 | 90 | 0 | 2363 | 26 |
|
||||
| balanceOf | 0 | 264 | 0 | 2753 | 55 |
|
||||
| balanceOfAt | 0 | 182 | 0 | 2363 | 30 |
|
||||
| changeController | 0 | 507 | 0 | 3558 | 10 |
|
||||
| claimTokens | 9537 | 41281 | 57154 | 57154 | 3 |
|
||||
| controller | 0 | 0 | 0 | 0 | 8 |
|
||||
@@ -15,7 +15,7 @@
|
||||
| decimals | 0 | 0 | 0 | 0 | 8 |
|
||||
| destroyTokens | 2308 | 5206 | 4310 | 9001 | 3 |
|
||||
| enableTransfers | 0 | 0 | 0 | 0 | 3 |
|
||||
| generateTokens | 0 | 7184 | 0 | 95808 | 40 |
|
||||
| generateTokens | 0 | 7009 | 0 | 95808 | 41 |
|
||||
| name | 0 | 0 | 0 | 0 | 8 |
|
||||
| parentSnapShotBlock | 0 | 0 | 0 | 0 | 9 |
|
||||
| parentToken | 0 | 0 | 0 | 0 | 9 |
|
||||
@@ -23,7 +23,7 @@
|
||||
| symbol | 0 | 0 | 0 | 0 | 8 |
|
||||
| totalSupply | 0 | 212 | 0 | 1911 | 9 |
|
||||
| totalSupplyAt | 0 | 285 | 0 | 1995 | 7 |
|
||||
| transfer | 526 | 38443 | 50395 | 75193 | 18 |
|
||||
| transfer | 526 | 39282 | 50395 | 93084 | 20 |
|
||||
| transferFrom | 0 | 16837 | 3495 | 66596 | 7 |
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ ClaimTokensTest:testClaimERC20() (gas: 63740)
|
||||
ClaimTokensTest:testClaimETH() (gas: 13637)
|
||||
ClaimTokensTest:testClaimSelf() (gas: 61222)
|
||||
ClaimTokensTest:testDeployment() (gas: 26595)
|
||||
CreateCloneTokenTest:testCreateCloneToken() (gas: 1853430)
|
||||
CreateCloneTokenTest:testCloneFutureSnapshot() (gas: 101250)
|
||||
CreateCloneTokenTest:testCreateCloneToken() (gas: 1853452)
|
||||
CreateCloneTokenTest:testDeployment() (gas: 26550)
|
||||
CreateCloneTokenTest:testGenerateTokens() (gas: 102079)
|
||||
DestroyTokensTest:testDeployment() (gas: 26595)
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
AllowanceAlreadySet,
|
||||
ControllerRejected,
|
||||
Overflow,
|
||||
ParentSnapshotNotReached,
|
||||
IERC20
|
||||
} from "../contracts/MiniMeBase.sol";
|
||||
import { MiniMeToken } from "../contracts/MiniMeToken.sol";
|
||||
@@ -811,6 +812,38 @@ contract CreateCloneTokenTest is MiniMeTokenTest {
|
||||
clone.generateTokens(accounts[0], 5);
|
||||
assertEq(clone.totalSupply(), 15, "total supply should be correct");
|
||||
}
|
||||
|
||||
function testCloneFutureSnapshot() public {
|
||||
vm.pauseGasMetering();
|
||||
_generateTokens(accounts[0], 10);
|
||||
|
||||
vm.prank(accounts[3]);
|
||||
MiniMeToken clone = new MiniMeToken(
|
||||
minimeTokenFactory,
|
||||
minimeToken,
|
||||
block.number+1,
|
||||
"TestFutureSnapshot",
|
||||
18,
|
||||
"TST",
|
||||
true
|
||||
);
|
||||
vm.expectRevert(ParentSnapshotNotReached.selector);
|
||||
vm.prank(accounts[0]);
|
||||
vm.resumeGasMetering();
|
||||
clone.transfer(accounts[1], 2);
|
||||
vm.pauseGasMetering();
|
||||
assertEq(clone.balanceOf(accounts[0]), 10, "balance of account 0 should not change");
|
||||
assertEq(clone.balanceOf(accounts[1]), 0, "balance of account 1 should not change");
|
||||
vm.roll(block.number + 2);
|
||||
vm.prank(accounts[0]);
|
||||
vm.resumeGasMetering();
|
||||
clone.transfer(accounts[1], 2);
|
||||
vm.pauseGasMetering();
|
||||
assertEq(clone.balanceOf(accounts[0]), 8, "balance of account 0 should be correct");
|
||||
assertEq(clone.balanceOf(accounts[1]), 2, "balance of account 1 should be correct");
|
||||
|
||||
vm.resumeGasMetering();
|
||||
}
|
||||
}
|
||||
|
||||
contract ClaimTokensTest is MiniMeTokenTest {
|
||||
|
||||
Reference in New Issue
Block a user