Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xp3th1um committed Jan 10, 2024
1 parent 48c5123 commit 8b394dc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
32 changes: 30 additions & 2 deletions src/DssSpell.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,7 @@ contract DssSpellTest is DssSpellTestBase {
// the address of the stream
// the planned fin of the stream (via variable defined above)
// Initialize the array with the corrent number of yanks
Yank[2] memory yanks = [
Yank(21, wallets.addr("DECO_WALLET"), MARCH_31_2024),
Yank[1] memory yanks = [
Yank(15, wallets.addr("SES_WALLET"), MARCH_31_2024)
];

Expand All @@ -537,6 +536,35 @@ contract DssSpellTest is DssSpellTestBase {
}
}

function testYankDAILegacy() public { // make private to disable
// Provide human-readable names for timestamps
uint256 MARCH_31_2024 = 1711929599;

// For each yanked stream, provide Yank object with:
// the stream id
// the address of the stream
// the planned fin of the stream (via variable defined above)
// Initialize the array with the corrent number of yanks
Yank[1] memory yanks = [
Yank(21, wallets.addr("DECO_WALLET"), MARCH_31_2024)
];

// Test stream id matches `addr` and `fin`
VestAbstract vest = VestAbstract(addr.addr("MCD_VEST_DAI_LEGACY"));
for (uint256 i = 0; i < yanks.length; i++) {
assertEq(vest.usr(yanks[i].streamId), yanks[i].addr, "testYankDAI/unexpected-address");
assertEq(vest.fin(yanks[i].streamId), yanks[i].finPlanned, "testYankDAI/unexpected-fin-date");
}

_vote(address(spell));
_scheduleWaitAndCast(address(spell));
assertTrue(spell.done());
for (uint256 i = 0; i < yanks.length; i++) {
// Test stream.fin is set to the current block after the spell
assertEq(vest.fin(yanks[i].streamId), block.timestamp, "testYankDAI/steam-not-yanked");
}
}

function testYankMKR() private { // make private to disable
// Provide human-readable names for timestamps
uint256 MARCH_31_2024 = 1711929599;
Expand Down
2 changes: 1 addition & 1 deletion src/test/config.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ contract Config {
});
afterSpell.collaterals["DIRECT-SPARK-DAI"] = CollateralValues({
aL_enabled: true,
aL_line: 800 * MILLION,
aL_line: 1200 * MILLION,
aL_gap: 20 * MILLION,
aL_ttl: 12 hours,
line: 0,
Expand Down

0 comments on commit 8b394dc

Please sign in to comment.