[#885] cli: Support hex chain id in control API

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
Denis Kirillov 2023-12-21 15:55:09 +03:00 committed by Evgenii Stratonikov
parent c19396d203
commit 4a4c790ec1
4 changed files with 39 additions and 6 deletions

View file

@ -63,7 +63,7 @@ func listRules(cmd *cobra.Command, _ []string) {
// TODO (aarifullin): make pretty-formatted output for chains.
var chain apechain.Chain
commonCmd.ExitOnErr(cmd, "decode error: %w", chain.DecodeBytes(c))
cmd.Println("Parsed chain:\n" + prettyJSONFormat(cmd, chain.Bytes()))
cmd.Printf("Parsed chain (chain id hex: '%x'):\n%s\n", chain.ID, prettyJSONFormat(cmd, chain.Bytes()))
}
}