Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Esm ward test #334

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6372113
reset to base spell
iamchrissmith Mar 31, 2023
dec50a1
additional reset to compile
iamchrissmith Mar 31, 2023
cc42539
add GSM delay change
iamchrissmith Mar 31, 2023
ffe4a87
turn office hours off
iamchrissmith Mar 31, 2023
c3efc5d
add delegate payments
iamchrissmith Mar 31, 2023
e807f70
add Responsible Facilitator Dai Streams
iamchrissmith Mar 31, 2023
74b4a32
add Responsible Facilitator MKR Streams
iamchrissmith Mar 31, 2023
cccb963
yank old SF-001 MKR streams
iamchrissmith Mar 31, 2023
38853c2
Responsible Facilitator MKR Transfers
iamchrissmith Mar 31, 2023
8774f21
use existing MKR transfer test
iamchrissmith Mar 31, 2023
d3d075c
add ecosystem actor dai streams
iamchrissmith Mar 31, 2023
f512d28
add ecosystem actor MKR vest
iamchrissmith Mar 31, 2023
eafa2e8
add RWA_LIQ_ORACLE authorization for ESM
iamchrissmith Apr 1, 2023
86c017e
add ecosystem actor dai transfers
iamchrissmith Apr 3, 2023
f1cc54c
fix timestamps and tests
iamchrissmith Apr 3, 2023
e36c23c
comment nits
iamchrissmith Apr 4, 2023
afca136
reorder and other minor changes
iamchrissmith Apr 4, 2023
be14b54
fix tech_wallet in tests
iamchrissmith Apr 4, 2023
83cf16d
Add esm blanket ward test
brianmcmichael Apr 4, 2023
28893c2
Move check to test
brianmcmichael Apr 4, 2023
9d5108f
Fix test
brianmcmichael Apr 4, 2023
d33add1
Check correct base
brianmcmichael Apr 4, 2023
0201c5b
Exceptions
brianmcmichael Apr 4, 2023
ac81928
Check for PP ward
brianmcmichael Apr 4, 2023
9387600
Use WardsAbstract
brianmcmichael Apr 4, 2023
4fc8850
Clear prev spell
brianmcmichael Apr 25, 2023
0ca4e99
upd copyright
brianmcmichael Apr 25, 2023
a964bcd
Test comment
brianmcmichael Apr 25, 2023
d7685c7
Add exceptions blanket
brianmcmichael Apr 25, 2023
a37052b
merge master, resolving conflicts
brianmcmichael Apr 25, 2023
456ef72
private tests
brianmcmichael Apr 25, 2023
890de84
Add break
brianmcmichael Apr 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
405 changes: 300 additions & 105 deletions src/DssSpell.sol

Large diffs are not rendered by default.

37 changes: 33 additions & 4 deletions src/DssSpell.t.base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import "./test/rates.sol";
import "./test/addresses_mainnet.sol";
import "./test/addresses_deployers.sol";
import "./test/addresses_wallets.sol";
import "./test/esm_exceptions.sol";
import "./test/config.sol";

import {DssSpell} from "./DssSpell.sol";
Expand All @@ -37,6 +38,10 @@ struct TeleportGUID {
uint48 timestamp;
}

interface AuthLike {
function wards(address) external view returns (uint256);
}

naszam marked this conversation as resolved.
Show resolved Hide resolved
interface DirectDepositLike is GemJoinAbstract {
function file(bytes32, uint256) external;
function exec() external;
Expand Down Expand Up @@ -144,10 +149,11 @@ interface AuthorityLike {
}

contract DssSpellTestBase is Config, DssTest {
Rates rates = new Rates();
Addresses addr = new Addresses();
Deployers deployers = new Deployers();
Wallets wallets = new Wallets();
Rates rates = new Rates();
Addresses addr = new Addresses();
Deployers deployers = new Deployers();
Wallets wallets = new Wallets();
EsmExceptions exceptions = new EsmExceptions();

// ADDRESSES
ChainlogAbstract chainLog = ChainlogAbstract( addr.addr("CHANGELOG"));
Expand Down Expand Up @@ -1999,4 +2005,27 @@ contract DssSpellTestBase is Config, DssTest {
vat.move(address(this), address(0x0), vat.dai(address(this)));
}

function _checkESMWards() internal {

bytes32[] memory _tags = chainLog.list();
bytes32[] memory _exceptions = exceptions.list();

for (uint256 i = 0; i < _tags.length; i++) {
bool _found = false;
for (uint256 j = 0; j < _exceptions.length; j++) {
if (_tags[i] == _exceptions[j]) {
_found = true;
naszam marked this conversation as resolved.
Show resolved Hide resolved
}
}
if (!_found) {
address _tagAddr = chainLog.getAddress(_tags[i]);
(bool ok, bytes memory data) = address(_tagAddr).call(
abi.encodeWithSignature("wards(address)", address(esm))
);
if (ok && AuthLike(_tagAddr).wards(pauseProxy) == 1) {
naszam marked this conversation as resolved.
Show resolved Hide resolved
assertEq(uint256(bytes32(data)), 1, _concat("TestError/not-esm-ward-", _tags[i]));
}
}
}
}
}
Loading