-
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
feat(cli): hardcode table ID with codegen #2229
Conversation
🦋 Changeset detectedLatest commit: 74c08c3 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 |
ResourceId constant _tableId = ResourceId.wrap( | ||
bytes32(abi.encodePacked(RESOURCE_TABLE, bytes14("store"), bytes16("StoreHooks"))) | ||
); | ||
ResourceId constant _tableId = ResourceId.wrap(0x746273746f726500000000000000000053746f7265486f6f6b73000000000000); |
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.
I don't mind this being a bit obscure since it's codegen, but if we feel like this magic constant should be clarified to end-users, we could add some codegen'ed comments above this explaining what's in this hex value (so we still get clarity along with gas benefits)
ResourceId constant _tableId = ResourceId.wrap( | ||
bytes32(abi.encodePacked(RESOURCE_TABLE, bytes14(""), bytes16("Multi"))) | ||
); | ||
ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004d756c74690000000000000000000000); |
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 a comment above these that explains this hex value?
Something like
// Hex below is the result of `WorldResourceIdLib.encode({ namespace: "", name: "Multi", typeId: RESOURCE_TABLE });`
5b707f7
to
74c08c3
Compare
doing this as a precursor to #2166 and found that this had a gas improvement in the hot path!