aboutsummaryrefslogtreecommitdiffstats
path: root/core/types/transaction.go
diff options
context:
space:
mode:
authorSteven Roose <stevenroose@gmail.com>2018-04-05 20:13:02 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-04-05 20:13:02 +0800
commitec8ee611caefb5c5ad5d796178e94c1919260df4 (patch)
tree275a9f91e33abfdafa0a6fdf113e4601616545cd /core/types/transaction.go
parent1e248f3a6e14f3bfc9ebe1b315c4194300220f68 (diff)
downloaddexon-ec8ee611caefb5c5ad5d796178e94c1919260df4.tar
dexon-ec8ee611caefb5c5ad5d796178e94c1919260df4.tar.gz
dexon-ec8ee611caefb5c5ad5d796178e94c1919260df4.tar.bz2
dexon-ec8ee611caefb5c5ad5d796178e94c1919260df4.tar.lz
dexon-ec8ee611caefb5c5ad5d796178e94c1919260df4.tar.xz
dexon-ec8ee611caefb5c5ad5d796178e94c1919260df4.tar.zst
dexon-ec8ee611caefb5c5ad5d796178e94c1919260df4.zip
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.
Diffstat (limited to 'core/types/transaction.go')
-rw-r--r--core/types/transaction.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go
index 5660582ba..70d757c94 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -19,7 +19,6 @@ package types
import (
"container/heap"
"errors"
- "fmt"
"io"
"math/big"
"sync/atomic"
@@ -262,58 +261,6 @@ func (tx *Transaction) RawSignatureValues() (*big.Int, *big.Int, *big.Int) {
return tx.data.V, tx.data.R, tx.data.S
}
-func (tx *Transaction) String() string {
- var from, to string
- if tx.data.V != nil {
- // make a best guess about the signer and use that to derive
- // the sender.
- signer := deriveSigner(tx.data.V)
- if f, err := Sender(signer, tx); err != nil { // derive but don't cache
- from = "[invalid sender: invalid sig]"
- } else {
- from = fmt.Sprintf("%x", f[:])
- }
- } else {
- from = "[invalid sender: nil V field]"
- }
-
- if tx.data.Recipient == nil {
- to = "[contract creation]"
- } else {
- to = fmt.Sprintf("%x", tx.data.Recipient[:])
- }
- enc, _ := rlp.EncodeToBytes(&tx.data)
- return fmt.Sprintf(`
- TX(%x)
- Contract: %v
- From: %s
- To: %s
- Nonce: %v
- GasPrice: %#x
- GasLimit %#x
- Value: %#x
- Data: 0x%x
- V: %#x
- R: %#x
- S: %#x
- Hex: %x
-`,
- tx.Hash(),
- tx.data.Recipient == nil,
- from,
- to,
- tx.data.AccountNonce,
- tx.data.Price,
- tx.data.GasLimit,
- tx.data.Amount,
- tx.data.Payload,
- tx.data.V,
- tx.data.R,
- tx.data.S,
- enc,
- )
-}
-
// Transactions is a Transaction slice type for basic sorting.
type Transactions []*Transaction