Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Dec 20, 2023
1 parent 8606215 commit bdd9915
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 7 additions & 4 deletions scripts/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@
def main():
json_str = request.urlopen(CHEATCODES_JSON_URL).read().decode("utf-8")
contract = Cheatcodes.from_json(json_str)
contract.cheatcodes.sort(key=lambda cc: cc.func.id)

safe = list(filter(lambda cc: cc.safety == Safety.SAFE, contract.cheatcodes))
ccs = contract.cheatcodes
ccs = list(filter(lambda cc: cc.status != Status.EXPERIMENTAL, ccs))
ccs.sort(key=lambda cc: cc.func.id)

safe = list(filter(lambda cc: cc.safety == Safety.SAFE, ccs))
safe.sort(key=CmpCheatcode)
unsafe = list(filter(lambda cc: cc.safety == Safety.UNSAFE, contract.cheatcodes))
unsafe = list(filter(lambda cc: cc.safety == Safety.UNSAFE, ccs))
unsafe.sort(key=CmpCheatcode)
assert len(safe) + len(unsafe) == len(contract.cheatcodes)
assert len(safe) + len(unsafe) == len(ccs)

out = ""

Expand Down
10 changes: 4 additions & 6 deletions src/Vm.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bdd9915

Please sign in to comment.