Skip to content
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(cli): reset CLI command takes networkId flag and only modifies if given #3690

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

mat-if
Copy link
Contributor

@mat-if mat-if commented Mar 23, 2023

Summary

Currently, there is no way to modify your network ID unless you manually edit the internal.json file. Combined with the usage of reset changing slightly to work more like a soft reset to allow changing between networks or just reset chain data, it makes sense to only optionally re-write the network ID if passed via flag. Otherwise, leave it unmodified

Testing Plan

image

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

@mat-if mat-if requested a review from a team as a code owner March 23, 2023 23:35
let networkIdMessage = ''
if (flags.networkId != null) {
const existingId = this.sdk.internal.get('networkId')
networkIdMessage = `\n\nThe network ID will be changed from ${existingId} to the new value of ${flags.networkId}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - do we still want to print this message if existingId === flags.networkId?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about that. I don't feel super strong one way or another, but I think the explicitness is nice, so one could see if maybe they're already on the right network, or accidentally mistyped the number or something

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have evidence to support one option being better -- I think skipping the message would be a bit unclear as to whether a change will happen or not, but I'm not sure if it's more helpful to have a message that says Your network ID will stay unchanged as ${existingId}. I'm okay with it either way and changing it if we get user feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call - that makes it clear in all scenarios. Change incoming

let networkIdMessage = ''
if (flags.networkId != null) {
const existingId = this.sdk.internal.get('networkId')
networkIdMessage = `\n\nThe network ID will be changed from ${existingId} to the new value of ${flags.networkId}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have evidence to support one option being better -- I think skipping the message would be a bit unclear as to whether a change will happen or not, but I'm not sure if it's more helpful to have a message that says Your network ID will stay unchanged as ${existingId}. I'm okay with it either way and changing it if we get user feedback.

@mat-if mat-if merged commit 357e1eb into staging Mar 24, 2023
@mat-if mat-if deleted the mat/optional-network-reset branch March 24, 2023 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants