[cli] Add a mechanism to cache the chain id to the client.yaml file.
#24072
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.
Description
This PR adds a caching of chain-id to the Sui CLI. This will be used in the new pkg-alt system.
In particular, the caching will happen when one of the
clientcommands will do an RPC request anyway / or execute a tx. It will not happen when any client command does not work with the RPC.For
publishandupgrade, it will try first to load it from cache; if it does not exist, then it will cache it. For all other commands it will always cache it.Test plan
Manual test with check on the
client.yamlfile. Tested also the updatedclient.yamlfile with an old CLI to ensure backwards compatibility.Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.