signer: tidy up output of OnApprovedTx

This commit is contained in:
Martin Holst Swende 2019-02-06 09:15:08 +01:00
parent 947405e972
commit 656b1659eb
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -18,12 +18,12 @@ package core
import ( import (
"bufio" "bufio"
"encoding/json"
"fmt" "fmt"
"os" "os"
"strings" "strings"
"sync" "sync"
"github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
@ -264,7 +264,11 @@ func (ui *CommandlineUI) ShowInfo(message string) {
func (ui *CommandlineUI) OnApprovedTx(tx ethapi.SignTransactionResult) { func (ui *CommandlineUI) OnApprovedTx(tx ethapi.SignTransactionResult) {
fmt.Printf("Transaction signed:\n ") 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) { func (ui *CommandlineUI) OnSignerStartup(info StartupInfo) {