-
Notifications
You must be signed in to change notification settings - Fork 184
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(cli,world): move helper functions into world package, add getWorldAbi #3012
Conversation
|
packages/world/ts/getWorldDeploy.ts
Outdated
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.
do we need to move this? I don't think this is used by any helpers here
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.
It's needed because of how getWorldAbi
is expecting the world deploy to be passed as one of the parameters https://github.com/latticexyz/mud/pull/2849/files#diff-c387c5680d2d7ed3fc8008e9769b2c37be5e4e2a0f11dda28f02521618047d1fR48-R53 . Subsequently, the world deploy param is used in getResourceIds({ client, worldDeploy })
, getFunctions({ client, worldDeploy })
, getResourceAccess({ client, worldDeploy })
, getTableValue
, and maybe some more.
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 we change the helper signatures to not be deployment specific and take in just what they need (i.e. world address, from/to block), we won't need this!
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.
Ah that's right, just removed the worldDeploy
dependency everywhere, and updated getSystems
params to be:
export async function getSystems({
client,
worldAddress,
stateBlock,
deployBlock,
}: {
readonly client: Client;
readonly worldAddress: Address;
readonly stateBlock: bigint;
readonly deployBlock: bigint;
}): Promise<readonly DeployedSystem[]> {
...
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.
And updated all other helper functions to take in only the required params i.e. no more worldDeploy
.
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.
overall looks good, but might consider including the entire base interface of the world alongside the world-scoped system functions
Great! Good idea, makes sense to add base ABI at this layer, just added. |
Co-authored-by: Kevin Ingersoll <[email protected]>
getWorldAbi
pulled out of #2849