diff --git a/test/staking/Staking.t.sol b/test/staking/Staking.t.sol index e72280a..dc12cf9 100644 --- a/test/staking/Staking.t.sol +++ b/test/staking/Staking.t.sol @@ -41,6 +41,7 @@ contract StakingTest is Test { event DistributorSet(address distributor); event WarmupSet(uint256 warmup); + event Ghosted(bytes32 indexed receiver, uint256 indexed amount); function setUp() public { vm.startPrank(initializer); @@ -579,6 +580,28 @@ contract StakingTest is Test { 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 { vm.prank(vault); ftso.mint(who, value);