From e5e5395830ce0e220afb116647189dae8cf8c4b7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 14 Oct 2021 11:27:08 +0300 Subject: [PATCH] [#833] cli/netmap: Beautify output of MillisecondsPerBlock parameter Convert milliseconds to `time.Duration` value and use its stringer in `netinfo` command. Signed-off-by: Leonard Lyubich --- cmd/neofs-cli/modules/netmap.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/neofs-cli/modules/netmap.go b/cmd/neofs-cli/modules/netmap.go index ebb9a8353..3f2ec88e1 100644 --- a/cmd/neofs-cli/modules/netmap.go +++ b/cmd/neofs-cli/modules/netmap.go @@ -3,6 +3,7 @@ package cmd import ( "context" "encoding/hex" + "time" "github.com/mr-tron/base58" "github.com/nspcc-dev/neo-go/pkg/config/netmode" @@ -162,7 +163,7 @@ var netInfoCmd = &cobra.Command{ magic := netInfo.MagicNumber() cmd.Printf("Network magic: [%s] %d\n", netmode.Magic(magic), magic) - cmd.Printf("MillisecondsPerBlock: %d\n", netInfo.MsPerBlock()) + cmd.Printf("Time per block: %s\n", time.Duration(netInfo.MsPerBlock())*time.Millisecond) netCfg := netInfo.NetworkConfig()