latticexyz / mud

MUD is a framework for building autonomous worlds
https://mud.dev
MIT License
724 stars 181 forks source link

add tests that checks if a table is registered when used #2883

Open holic opened 4 months ago

holic commented 4 months ago

from https://github.com/latticexyz/mud/pull/2877#discussion_r1622262839

we could set up our tests to track storage access, then check that all tables accessed were registered: https://github.com/foundry-rs/forge-std/blob/52715a217dc51d0de15877878ab8213f6cbbbab5/src/Vm.sol#L406-L407

not sure how hard this will be with our storage slots being hashes of table ID + key, but maybe there's something smart we can do here?