core/types: remove String methods from struct types (#16205)

Most of these methods did not contain all the relevant information
inside the object and were not using a similar formatting type.
Moreover, the existence of a suboptimal String method breaks usage
with more advanced data dumping tools like go-spew.
This commit is contained in:
Steven Roose
2018-04-05 14:13:02 +02:00
committed by Felix Lange
parent 1e248f3a6e
commit ec8ee611ca
7 changed files with 3 additions and 127 deletions

View File

@ -25,6 +25,7 @@ import (
"strings"
"time"
"github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
@ -1388,7 +1389,7 @@ func (api *PublicDebugAPI) PrintBlock(ctx context.Context, number uint64) (strin
if block == nil {
return "", fmt.Errorf("block #%d not found", number)
}
return block.String(), nil
return spew.Sdump(block), nil
}
// SeedHash retrieves the seed hash of a block.