Skip to content

Instantly share code, notes, and snippets.

@jbcarpanelli
Last active February 14, 2024 16:52
Show Gist options
  • Save jbcarpanelli/6712c1c882e30263d6e34e08b4808f9b to your computer and use it in GitHub Desktop.
Save jbcarpanelli/6712c1c882e30263d6e34e08b4808f9b to your computer and use it in GitHub Desktop.

Add the following test in the FortaStakingVault.t.sol file:

    function test_stall_undelegations() external {
        _deposit(alice, 100 ether, 100 ether);

        uint256 subject1 = 55;

        //delegate and initiate undelegate
        vm.startPrank(operator);
        vault.delegate(subject1, 50 ether);
        (, address distributor) = vault.initiateUndelegate(subject1, 50 ether);
        vm.stopPrank();


        // wait thawing period
        vm.warp(block.timestamp + 20 days);

        // send 1 FORT to bob and transfer it to the distributor 
        vm.startPrank(bob);
        deal(address(FORT_TOKEN), bob, 1);
        FORT_TOKEN.transfer(distributor, 1);
        vm.stopPrank();

        // undelegate subjects
        vault.undelegate(subject1);
    }

Finally, run in a console the following command:

~$ forge test --mt test_stall_undelegations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment