Skip to content

sui_v1.7.0_1690568900_ci

@stefan-mysten stefan-mysten tagged this 28 Jul 17:56
## Description 

Revamp the keytool CLI command to pretty print output as formatted
tables and add support for json output. This is the first experimental
step to gain feedback before moving to other CLI commands.

The PR also removes seven commands that should not be part of the CLI
and were OK'ed by @siomari and @ammn to be removed:
* Base64PubKeyToAddress
* BytesToBase64
* Base64ToBytes
* Base64ToHex
* BytesToHex
* HexToBase64
* HexToBytes

## Test Plan 

Executed the existing tests. 

---
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
- [x] 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
This PR modifies the `CLI keytool` as follows:
* Adds support for `json` output. Use the `--json` flag when invoking
any `keytool` command (such as `keytool list --json`).
* Changes the default output to the terminal to formatted tables with
headers to improve consistency across different commands. Use `--json`
if you need to parse/pipe output data.
* Removes the following seven commands, which you can replace by calls
to the `base64` and `xxd` utilities:
```
Base64PubKeyToAddress
BytesToBase64
Base64ToBytes
Base64ToHex -> input | base64 -d | xxd -p
BytesToHex
HexToBase64 -> input | xxd -r -p | base64
HexToBytes 
```
Assets 2
Loading