-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(store): event interfaces for Store libraries #2348
Conversation
🦋 Changeset detectedLatest commit: 091a713 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
/** | ||
* @title IFieldLayoutErrors | ||
* @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) | ||
* @notice This interface includes errors for the FieldLayout library. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the why to each of these?
/** | |
* @title IFieldLayoutErrors | |
* @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) | |
* @notice This interface includes errors for the FieldLayout library. | |
*/ | |
/** | |
* @title IFieldLayoutErrors | |
* @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) | |
* @notice This interface includes errors for the FieldLayout library. | |
* @dev We centralize and reference these errors in an interface (instead of in libraries or files) so that we can ensure that all possible errors are included in the resulting Store ABI for proper decoding in the frontend. This is a workaround until the Solidity compiler does this for us. | |
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good! just want to include a comment in each interface about why we're doing this approach, for future spelunkers (including ourselves)
did we double check we got all error types?
I agree we can improve the comments! afaik this covers all events in Store, then we tackle World later.
Gonna reword this because I don't think this is actually a bug - we just didn't include those events in |
wondering if we should include some/all errors in the other interfaces as well: https://github.com/latticexyz/mud/blob/main/packages/store/src/IStoreRead.sol#L13 |
Technically yes, but I tried it and there is an issue with inheritance ( If we wanna do this properly, we should actually remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more comment for IStoreErrors
imo (since it's the same pattern as our other error interfaces) but otherwise lgtm
don't forget a changeset! |
Exploring my comment on #2158 (comment)
Basically some errors (
FieldLayoutLib_*
,PackedCounter_*
, etc.), are not included in theIStore
ABI because they are not defined in that interface or anything it inherits. Instead, they are defined in libraries and are referenced only in the implementation of Store.Some solutions:
IPackedCounterErrors
(this PR)IStoreErrors
Store
implementation