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

[cli] improve display for sui client new-address command #13675

Merged
merged 1 commit into from
Sep 10, 2023

Conversation

stefan-mysten
Copy link
Contributor

@stefan-mysten stefan-mysten commented Sep 7, 2023

Description

When requesting a new keypair via sui client new-address, display the newly created keypair in a well formatted table.

Test Plan

image

How did you test the new or updated feature?


If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

Updates the default output for the sui client new-address <KEY_PAIR_SCHEME> command in the Sui Client CLI. The console now displays a well-formatted table with the key pair details. If you include the --json flag (sui client new-address <KEY_PAIR_SCHEME> --json), the console displays the JSON representation of the key pair details instead.

@vercel
Copy link

vercel bot commented Sep 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2023 4:42am
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2023 4:42am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Sep 10, 2023 4:42am
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Sep 10, 2023 4:42am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Sep 10, 2023 4:42am

Copy link
Contributor

@amnn amnn left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -1046,12 +1047,17 @@ impl SuiClientCommands {
derivation_path,
word_length,
} => {
let (address, phrase, scheme) = context.config.keystore.generate_and_add_new_key(
let (address, phrase, _scheme) = context.config.keystore.generate_and_add_new_key(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is scheme unused because it's already captured in key_scheme?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, key_scheme (user provided) and scheme (returned by keystore) are the same.

@amnn
Copy link
Contributor

amnn commented Sep 7, 2023

nit: In the screenshot, it looks lie the phrase "Created new keypair and saved it to keystore." is clipping through the table output. Is that being output to stderr or something? It would be worth cleaning that up if you could.

@stefan-mysten
Copy link
Contributor Author

nit: In the screenshot, it looks lie the phrase "Created new keypair and saved it to keystore." is clipping through the table output. Is that being output to stderr or something? It would be worth cleaning that up if you could.

Good observation. It's unfortunately a limitation of the crate we're using. I will try to see if I can manually draw the vertical lines only for rows 1-3.

@stefan-mysten
Copy link
Contributor Author

stefan-mysten commented Sep 10, 2023

nit: In the screenshot, it looks lie the phrase "Created new keypair and saved it to keystore." is clipping through the table output. Is that being output to stderr or something? It would be worth cleaning that up if you could.

Good observation. It's unfortunately a limitation of the crate we're using. I will try to see if I can manually draw the vertical lines only for rows 1-3.

Fixed!

image

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.

2 participants