From 656b1659ebd8f83253a085ef339377b64ff5248a Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 6 Feb 2019 09:15:08 +0100 Subject: [PATCH] signer: tidy up output of OnApprovedTx --- signer/core/cliui.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/signer/core/cliui.go b/signer/core/cliui.go index 71d489d459..3ffc6b1916 100644 --- a/signer/core/cliui.go +++ b/signer/core/cliui.go @@ -18,12 +18,12 @@ package core import ( "bufio" + "encoding/json" "fmt" "os" "strings" "sync" - "github.com/davecgh/go-spew/spew" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/log" @@ -264,7 +264,11 @@ func (ui *CommandlineUI) ShowInfo(message string) { func (ui *CommandlineUI) OnApprovedTx(tx ethapi.SignTransactionResult) { fmt.Printf("Transaction signed:\n ") - spew.Dump(tx.Tx) + if jsn, err := json.MarshalIndent(tx.Tx, " ", " "); err != nil { + fmt.Printf("WARN: marshalling error %v\n", err) + } else { + fmt.Println(string(jsn)) + } } func (ui *CommandlineUI) OnSignerStartup(info StartupInfo) {