-
Notifications
You must be signed in to change notification settings - Fork 222
Closed as not planned
Description
There are some places in the code where structures such as map[felt.Felt]map[felt.Felt]*felt.Felt to refer to StorageDiff or map[felt.Felt]*felt.Felt to refer to others like DeployedContracts, are used.
We could define instead a custom type like:
type StorageDiff map[felt.Felt]map[felt.Felt]*felt.Felt
Or consider creating types such as Address or ClassHash for felts, so DeployedContracts map would look like map[Address]ClassHash.
This will allow the code to be more readable and easier to work with (when creating new structures or passing them as arguments in functions). It would also make it safer as you restrict the specific type that must be used (not just any felt for example), and it even allows to create methods on top of these structures.
Check out these two comments for reference:
rodrodrosDeeptanshu-sankhwar