-
Notifications
You must be signed in to change notification settings - Fork 185
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(world): change registerFunctionSelector signature to accept system signature as a single string #1574
Conversation
alvrs
commented
Sep 22, 2023
- registerFunctionSelector now accepts the system function signature as a single string. There was no point in separating name and arguments.
🦋 Changeset detectedLatest commit: d094f5b The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 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. |
ResourceId systemId, | ||
- string memory systemFunctionName, | ||
- string memory systemFunctionArguments | ||
+ string memory systemFunctionSignature |
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.
is it important to call this “system” here? I noticed the method doesn’t mention system
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 see now that there’s a difference between world and system function signatures/selectors so clarifying here makes sense. I suggested a change to the function name in the other PR
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.
there is a nuance here that the naming is trying to make explicit: you're passing the signature of the function in the system contract (e.g. increment()
), but the resulting world function signature will be <namespace>_<systemName>_increment()
! That's why the returned selector is called worldFunctionSelector
Edit: didn't see your second reply before posting my reply
@@ -26,7 +26,7 @@ contract PostDeploy is Script { | |||
name: "ChatNamespaced" | |||
}); | |||
IWorld(worldAddress).registerSystem(systemId, chatNamespacedSystem, true); | |||
IWorld(worldAddress).registerFunctionSelector(systemId, "sendMessage", "(string)"); | |||
IWorld(worldAddress).registerFunctionSelector(systemId, "sendMessage(string)"); |
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.
So much nicer
…em signature as a single string
4aab3cf
to
d094f5b
Compare