makerdao / spells-mainnet

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

Improve `testRemoveChainlogValues` #386

Closed amusingaxl closed 3 months ago

amusingaxl commented 5 months ago

The current implementation of testRemoveChainlogValues can generate false positives in case there is a typo in the key in the test file:

    function testRemoveChainlogValues() public skipTest { // add the `skipTest` modifier to skip
        _vote(address(spell));
        _scheduleWaitAndCast(address(spell));
        assertTrue(spell.done(), "TestError/spell-not-done");

        try chainLog.getAddress("MCD_CAT") {
            assertTrue(false);
        } catch Error(string memory errmsg) {
            assertTrue(_cmpStr(errmsg, "dss-chain-log/invalid-key"));
        } catch {
            assertTrue(false);
        }
    }

Ideally, we would want to query for any removed keys before the spell is executed and if they have been properly removed after that.