makerdao / spells-mainnet

Staging repo for MakerDAO weekly executive spells
GNU Affero General Public License v3.0
107 stars 43 forks source link

Esm ward test #334

Open brianmcmichael opened 1 year ago

brianmcmichael commented 1 year ago

Adds a test of esm ward on every chainlog entry.

New additions to the chainlog that do not need to be a ward on the ESM will need to be added to the exceptions list.

For every exception, it would be helpful to include reason why.

brianmcmichael commented 1 year ago

This is draft PR. Added "WETH" and "USDC" to start. Will need to analyze this list and create/fix exceptions as necessary.

https://gist.github.com/brianmcmichael/d756d321c3f68d6d97ad58f8deeb85e4

naszam commented 1 year ago

Test PASS at 456ef72:

➜  spells-mainnet git:(ESM_WARD_TEST) make test
./scripts/test-dssspell-forge.sh match="" block=""
Using DssExecLib at: 0x8De6DDbCd5053d32292AAA0D2105A32d108484a6
[⠰] Compiling...
[⠃] Compiling 7 files with 0.8.16
[⠰] Solc 0.8.16 finished in 3.39s
Compiler run successful

Running 2 tests for src/test/starknet.t.sol:StarknetTests
[PASS] testStarknet() (gas: 532119)
[PASS] testStarknetSpell() (gas: 2346)
Test result: ok. 2 passed; 0 failed; finished in 1.07s

Running 18 tests for src/DssSpell.t.sol:DssSpellTest
[PASS] testAuth() (gas: 9223371487102283060)
[PASS] testAuthInSources() (gas: 9223371487099283588)
[PASS] testBytecodeMatches() (gas: 1333016)
[PASS] testCastCost() (gas: 377556)
[PASS] testChainlogValues() (gas: 8625067)
[PASS] testChainlogVersionBump() (gas: 3759812)
[PASS] testContractSize() (gas: 8984)
[PASS] testDeployCost() (gas: 1321532)
[PASS] testESMWards() (gas: 9223371487100745242)
[PASS] testFailNotScheduled() (gas: 14375)
[PASS] testFailTooEarly() (gas: 13629)
[PASS] testFailTooLate() (gas: 13606)
[PASS] testFailWrongDay() (gas: 13607)
[PASS] testGeneral() (gas: 34575151)
[PASS] testNextCastTime() (gas: 353614)
[PASS] testOnTime() (gas: 373195)
[PASS] testPSMs() (gas: 1897685)
[PASS] testUseEta() (gas: 352346)
Test result: ok. 18 passed; 0 failed; finished in 60.39s