test for events for gatekeeper
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
00a7dea8fb
commit
8e2caaba0f
@ -41,6 +41,7 @@ contract StakingTest is Test {
|
|||||||
|
|
||||||
event DistributorSet(address distributor);
|
event DistributorSet(address distributor);
|
||||||
event WarmupSet(uint256 warmup);
|
event WarmupSet(uint256 warmup);
|
||||||
|
event Ghosted(bytes32 indexed receiver, uint256 indexed amount);
|
||||||
|
|
||||||
function setUp() public {
|
function setUp() public {
|
||||||
vm.startPrank(initializer);
|
vm.startPrank(initializer);
|
||||||
@ -579,6 +580,28 @@ contract StakingTest is Test {
|
|||||||
assertEq(ghst.totalSupply(), 0);
|
assertEq(ghst.totalSupply(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_ghostTokensEmitsEvent() public {
|
||||||
|
assertEq(staking.gatekeeper(), address(0));
|
||||||
|
vm.prank(governor);
|
||||||
|
staking.setGatekeeperAddress(address(gatekeeper));
|
||||||
|
assertEq(staking.gatekeeper(), address(gatekeeper));
|
||||||
|
|
||||||
|
_prepareAndRoll(alice, bigAmount, true, true);
|
||||||
|
uint256 aliceBalance = stnk.balanceOf(alice);
|
||||||
|
|
||||||
|
vm.startPrank(alice);
|
||||||
|
stnk.approve(address(staking), aliceBalance);
|
||||||
|
uint256 ghstBalance = staking.wrap(alice, aliceBalance);
|
||||||
|
vm.stopPrank();
|
||||||
|
|
||||||
|
bytes32 receiver = bytes32(abi.encodePacked(alice));
|
||||||
|
vm.expectEmit(true, true, true, false, address(gatekeeper));
|
||||||
|
emit Ghosted(receiver, ghstBalance);
|
||||||
|
|
||||||
|
vm.prank(alice);
|
||||||
|
staking.ghost(receiver, ghstBalance);
|
||||||
|
}
|
||||||
|
|
||||||
function _mintAndApprove(address who, uint256 value) internal {
|
function _mintAndApprove(address who, uint256 value) internal {
|
||||||
vm.prank(vault);
|
vm.prank(vault);
|
||||||
ftso.mint(who, value);
|
ftso.mint(who, value);
|
||||||
|
Loading…
Reference in New Issue
Block a user