-
Notifications
You must be signed in to change notification settings - Fork 194
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: rename key to keyTuple #1492
Conversation
3c2536f
to
c93145b
Compare
🦋 Changeset detectedLatest commit: 95dc04c The changes in this PR will be included in the next version bump. This PR includes changesets to release 28 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 |
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
bb8cc29
to
84716aa
Compare
c93145b
to
af1c6da
Compare
af1c6da
to
6810138
Compare
Co-authored-by: Kevin Ingersoll <[email protected]>
48c5fdc
to
09755c6
Compare
6810138
to
7232778
Compare
|
||
// If the key has not yet been set in the table... | ||
// If the keyTuple has not yet been set in the table... |
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.
// If the keyTuple has not yet been set in the table... | |
// If the key has not yet been set in the table... |
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Update the index to avoid duplicating this key in the array | ||
// Update the index to avoid duplicating this keyTuple in the array |
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.
// Update the index to avoid duplicating this keyTuple in the array | |
// Update the index to avoid duplicating this key in the array |
(bool has, uint40 index) = UsedKeysIndex.get(tableId, keysHash); | ||
|
||
// If the key was part of the table... | ||
// If the keyTuple was part of the table... |
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.
// If the keyTuple was part of the table... | |
// If the key was part of the table... |
if (has) { | ||
// Delete the index as the key is not in the table | ||
// Delete the index as the keyTuple is not in the table anymore |
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.
// Delete the index as the keyTuple is not in the table anymore | |
// Delete the index as the key is not in the table anymore |
@@ -112,15 +113,15 @@ contract KeysInTableHook is StoreHook { | |||
} | |||
} | |||
|
|||
// Update the index of lastKey after swapping it with the deleted key | |||
// Update the index of lastKey after swapping it with the deleted keyTuple |
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.
// Update the index of lastKey after swapping it with the deleted keyTuple | |
// Update the index of lastKey after swapping it with the deleted key |
@@ -6,22 +6,22 @@ import { IStore } from "@latticexyz/store/src/IStore.sol"; | |||
import { UsedKeysIndex } from "./tables/UsedKeysIndex.sol"; | |||
|
|||
/** | |||
* Get whether the key is in the given table. | |||
* Get whether the keyTuple is in the given table. |
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.
* Get whether the keyTuple is in the given table. | |
* Get whether the key is in the given table. |
|
||
return UsedKeysIndex.getHas(tableId, keysHash); | ||
} | ||
|
||
/** | ||
* Get whether the key is in the given table for the given store. | ||
* Get whether the keyTuple is in the given table for the given store. |
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.
* Get whether the keyTuple is in the given table for the given store. | |
* Get whether the key is in the given table for the given store. |
…to alvrs/rename-key-tuple
re: |
did another pass of self-review, gonna go ahead with merging this to unblock other PRs |
Fixes #1128
https://www.notion.so/latticexyz/MUD-naming-conventions-66e11356a1934465b2aa1a951c61a299