Repository navigation
fix(scripts): record the hex chain id in world.json - #348
Open
0xxlegolas wants to merge 1 commit into
Open
0xxlegolas wants to merge 1 commit into
0xxlegolas wants to merge 1 commit into
Conversation
Newer Sui CLIs print "Base58: …" and "Hex: …" lines for `sui client chain-identifier`, and the deploy scripts stored the whole output as chainId. Parse the hex value in a shared chain_id helper, reject anything that is not 8 hex characters in build-manifest.ts, and fix the bad value already recorded for dev. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the chain identifier handling changes.
No open issues 🎉
What changed in this PR
Ensures deployment manifests store the hexadecimal chain identifier expected by the SDK, rather than the labelled output from newer Sui CLIs.
Changes:
- Adds a shared helper that handles both CLI output formats and validates the identifier.
- Updates both deployment scripts to use the helper and adds validation in the manifest builder.
- Corrects the existing development manifest’s chain identifier.
| File | Description |
|---|---|
ts-scripts/build-manifest.ts |
Rejects chain identifiers that are not eight lowercase hex characters. |
scripts/lib.sh |
Adds chain identifier extraction and validation. |
scripts/deploy-world.sh |
Uses the shared helper when building the world manifest. |
scripts/deploy-currency.sh |
Uses the shared helper when building the currency manifest. |
deployments/dev/world.json |
Corrects chainId to 4c78adac. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Newer Sui CLIs print two labelled lines for
sui client chain-identifier:deploy-world.shanddeploy-currency.shstored the whole output aschainIdinworld.json, and the SDK (getWorldConfig) passes that value on as-is. Copilot flagged this on #347, where the value was fixed by hand.Changes
scripts/lib.sh: newchain_idhelper. It keeps theHex:value, falls back to the bare output on older CLIs, and fails unless the result is 8 hex characters.deploy-world.sh,deploy-currency.sh: usechain_id.ts-scripts/build-manifest.ts: rejects achainIdthat is not 8 hex characters.deployments/dev/world.json: corrects the bad value already onmainto4c78adac. Test's value is fixed in deploy(test): 1.1.20 #347.Note
Deploys run the scripts baked into the tagged image, so records PRs from
1.1.20or1.1.21will still carry the bad value. The fix applies to deploys from the first release cut after this merges.Testing
chain_idagainst Sui CLI 1.78 (two-line output), a stubbed bare-hex output, and invalid output, which fails.build-manifest.tsrejects the two-line value.biome check, and the SDK unit tests pass.🤖 Generated with Claude Code