From 2d69c5a86520b18ad3ef1d65ee43967b985e6d97 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 14 Oct 2021 11:40:51 +0300 Subject: [PATCH] cli: output fees as proper decimal values of GAS It's user-facing value and user-facing things should look good. --- cli/input/input.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/input/input.go b/cli/input/input.go index c8445766d..7dbc4a70a 100644 --- a/cli/input/input.go +++ b/cli/input/input.go @@ -8,6 +8,7 @@ import ( "syscall" "github.com/nspcc-dev/neo-go/pkg/core/transaction" + "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" "golang.org/x/term" ) @@ -61,9 +62,9 @@ func ReadPassword(prompt string) (string, error) { // ConfirmTx asks for a confirmation to send tx. func ConfirmTx(w io.Writer, tx *transaction.Transaction) error { - fmt.Fprintf(w, "Network fee: %d\n", tx.NetworkFee) - fmt.Fprintf(w, "System fee: %d\n", tx.SystemFee) - fmt.Fprintf(w, "Total fee: %d\n", tx.NetworkFee+tx.SystemFee) + fmt.Fprintf(w, "Network fee: %s\n", fixedn.Fixed8(tx.NetworkFee)) + fmt.Fprintf(w, "System fee: %s\n", fixedn.Fixed8(tx.SystemFee)) + fmt.Fprintf(w, "Total fee: %s\n", fixedn.Fixed8(tx.NetworkFee+tx.SystemFee)) ln, err := ReadLine("Relay transaction (y|N)> ") if err != nil { return err