Skip to content

Commit

Permalink
sanity checks for the new vests
Browse files Browse the repository at this point in the history
  • Loading branch information
SidestreamColdMelon committed Jan 20, 2025
1 parent 7c25df4 commit 3ef5580
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/DssSpell.t.base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2420,7 +2420,7 @@ contract DssSpellTestBase is Config, DssTest {
for (uint256 i = 0; i < _ss.length; i++) {
vestableAmt += _ss[i].tot - _ss[i].rxd;
}
assertGe(sky.allowance(pauseProxy, address(vestSky)), prevAllowance + vestableAmt, "testVestSky/invalid-allowance");
assertEq(sky.allowance(pauseProxy, address(vestSky)), prevAllowance + vestableAmt, "testVestSky/invalid-allowance");

// Check that all streams added in this spell are tested
assertEq(vestSky.ids(), prevStreamCount + _ss.length, "testVestSky/not-all-streams-tested");
Expand Down
20 changes: 20 additions & 0 deletions src/DssSpell.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ interface SequencerLike {
function hasJob(address job) external view returns (bool);
}

interface DssVestSuckableLike {
function chainlog() external view returns (address);
function join() external view returns (address);
}

interface DssVestTransferrableLike {
function czar() external view returns (address);
function gem() external view returns (address);
}

contract DssSpellTest is DssSpellTestBase {
// DO NOT TOUCH THE FOLLOWING TESTS, THEY SHOULD BE RUN ON EVERY SPELL
function testGeneral() public {
Expand Down Expand Up @@ -1134,4 +1144,14 @@ contract DssSpellTest is DssSpellTestBase {
}

// SPELL-SPECIFIC TESTS GO BELOW

function testNewUsdsVestConstructor() public view {
assertEq(DssVestSuckableLike(address(vestUsds)).chainlog(), address(chainLog), "TestError/unexpected-VestSuckable-constructor-chainlog");
assertEq(DssVestSuckableLike(address(vestUsds)).join(), address(usdsJoin), "TestError/unexpected-VestSuckable-constructor-join");
}

function testNewSkyVestConstructor() public view {
assertEq(DssVestTransferrableLike(address(vestSky)).czar(), address(pauseProxy), "TestError/unexpected-VestTransferrable-constructor-czar");
assertEq(DssVestTransferrableLike(address(vestSky)).gem(), address(sky), "TestError/unexpected-VestTransferrable-constructor-gem");
}
}

0 comments on commit 3ef5580

Please sign in to comment.