From f7f6dbaddc16dbfbce978673edf222c4deb90b93 Mon Sep 17 00:00:00 2001 From: 0xDecr1pto <0xdecr1pto@proton.me> Date: Thu, 24 Aug 2023 16:33:53 +0300 Subject: [PATCH] chore: fix tests --- src/DssSpell.t.sol | 28 ++++++++++++++++++++++++++-- src/test/config.sol | 2 +- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/DssSpell.t.sol b/src/DssSpell.t.sol index eba182134..2ae087ae5 100644 --- a/src/DssSpell.t.sol +++ b/src/DssSpell.t.sol @@ -52,6 +52,22 @@ interface ProxyLike { function exec(address target, bytes calldata args) external payable returns (bytes memory out); } +interface ERC20Proxy { + function erc20Impl() external returns (address); + + function totalSupply() external returns (uint256); +} + +interface ERC20Impl { + function erc20Store() external returns (address); +} + +interface ERC20Store { + function setTotalSupply(uint256 _newTotalSupply) external; + + function setBalance(address _owner, uint256 _newBalance) external; +} + contract DssSpellTest is DssSpellTestBase { string config; RootDomain rootDomain; @@ -641,7 +657,7 @@ contract DssSpellTest is DssSpellTestBase { } } - function testMKRPayments() public { // make public to enable + function testMKRPayments() private { // make public to enable // For each payment, create a Payee object with // the Payee address, // the amount to be paid @@ -1001,7 +1017,15 @@ contract DssSpellTest is DssSpellTestBase { uint256 urnBalanceBefore = dai.balanceOf(rwa015AUrn); uint256 jarBalanceBefore = dai.balanceOf(rwa015AJar); - GodMode.setBalance(address(gusd), address(this), 2 * gusdAmt); + // Add GUSD blance + address impl = ERC20Proxy(address(gusd)).erc20Impl(); + ERC20Store store = ERC20Store(ERC20Impl(impl).erc20Store()); + + vm.startPrank(impl); + store.setBalance(address(this), 2 * gusdAmt); + store.setTotalSupply(gusd.totalSupply() + 2 * gusdAmt); + vm.stopPrank(); + GodMode.setBalance(address(pax), address(this), 2 * paxAmt); // transfer GUSD to input conduit's diff --git a/src/test/config.sol b/src/test/config.sol index b86998700..e56db1252 100644 --- a/src/test/config.sol +++ b/src/test/config.sol @@ -110,7 +110,7 @@ contract Config { // // Values for all system configuration changes // - afterSpell.line_offset = 650 * MILLION; // Offset between the global line against the sum of local lines + afterSpell.line_offset = 680 * MILLION; // Offset between the global line against the sum of local lines afterSpell.pot_dsr = 5_00; // In basis points afterSpell.pause_delay = 48 hours; // In seconds afterSpell.vow_wait = 156 hours; // In seconds