From ec8ee611caefb5c5ad5d796178e94c1919260df4 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Thu, 5 Apr 2018 14:13:02 +0200 Subject: 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. --- mobile/types.go | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'mobile') diff --git a/mobile/types.go b/mobile/types.go index 4790afcef..24cd7ebf1 100644 --- a/mobile/types.go +++ b/mobile/types.go @@ -97,12 +97,6 @@ func (h *Header) EncodeJSON() (string, error) { return string(data), err } -// String implements the fmt.Stringer interface to print some semi-meaningful -// data dump of the header for debugging purposes. -func (h *Header) String() string { - return h.header.String() -} - func (h *Header) GetParentHash() *Hash { return &Hash{h.header.ParentHash} } func (h *Header) GetUncleHash() *Hash { return &Hash{h.header.UncleHash} } func (h *Header) GetCoinbase() *Address { return &Address{h.header.Coinbase} } @@ -174,12 +168,6 @@ func (b *Block) EncodeJSON() (string, error) { return string(data), err } -// String implements the fmt.Stringer interface to print some semi-meaningful -// data dump of the block for debugging purposes. -func (b *Block) String() string { - return b.block.String() -} - func (b *Block) GetParentHash() *Hash { return &Hash{b.block.ParentHash()} } func (b *Block) GetUncleHash() *Hash { return &Hash{b.block.UncleHash()} } func (b *Block) GetCoinbase() *Address { return &Address{b.block.Coinbase()} } @@ -249,12 +237,6 @@ func (tx *Transaction) EncodeJSON() (string, error) { return string(data), err } -// String implements the fmt.Stringer interface to print some semi-meaningful -// data dump of the transaction for debugging purposes. -func (tx *Transaction) String() string { - return tx.tx.String() -} - func (tx *Transaction) GetData() []byte { return tx.tx.Data() } func (tx *Transaction) GetGas() int64 { return int64(tx.tx.Gas()) } func (tx *Transaction) GetGasPrice() *BigInt { return &BigInt{tx.tx.GasPrice()} } @@ -347,12 +329,6 @@ func (r *Receipt) EncodeJSON() (string, error) { return string(data), err } -// String implements the fmt.Stringer interface to print some semi-meaningful -// data dump of the transaction receipt for debugging purposes. -func (r *Receipt) String() string { - return r.receipt.String() -} - func (r *Receipt) GetPostState() []byte { return r.receipt.PostState } func (r *Receipt) GetCumulativeGasUsed() int64 { return int64(r.receipt.CumulativeGasUsed) } func (r *Receipt) GetBloom() *Bloom { return &Bloom{r.receipt.Bloom} } -- cgit v1.2.3