@@ -47,7 +47,7 @@ func NewTransactionFromValue(val *ethutil.Value) *Transaction {
47
47
}
48
48
49
49
func (tx * Transaction ) Hash () []byte {
50
- data := []interface {}{tx .Nonce , tx .gasPrice , tx .gas , tx .recipient , tx .Value , tx .Data }
50
+ data := []interface {}{tx .nonce , tx .gasPrice , tx .gas , tx .recipient , tx .value , tx .data }
51
51
52
52
return crypto .Sha3 (ethutil .NewValue (data ).Encode ())
53
53
}
@@ -108,8 +108,8 @@ func (tx *Transaction) PublicKey() []byte {
108
108
sig := append (r , s ... )
109
109
sig = append (sig , v - 27 )
110
110
111
- pubkey := crypto .Ecrecover (append (hash , sig ... ))
112
- // pubkey, _ := secp256k1.RecoverPubkey(hash, sig)
111
+ // pubkey := crypto.Ecrecover(append(hash, sig...))
112
+ pubkey , _ := secp256k1 .RecoverPubkey (hash , sig )
113
113
114
114
return pubkey
115
115
}
@@ -138,9 +138,7 @@ func (tx *Transaction) Sign(privk []byte) error {
138
138
}
139
139
140
140
func (tx * Transaction ) RlpData () interface {} {
141
- data := []interface {}{tx .Nonce , tx .GasPrice , tx .Gas , tx .recipient , tx .Value , tx .Data }
142
-
143
- // TODO Remove prefixing zero's
141
+ data := []interface {}{tx .nonce , tx .gasPrice , tx .gas , tx .recipient , tx .value , tx .data }
144
142
145
143
return append (data , tx .v , new (big.Int ).SetBytes (tx .r ).Bytes (), new (big.Int ).SetBytes (tx .s ).Bytes ())
146
144
}
@@ -184,6 +182,7 @@ func (tx *Transaction) String() string {
184
182
V: 0x%x
185
183
R: 0x%x
186
184
S: 0x%x
185
+ Hex: %x
187
186
` ,
188
187
tx .Hash (),
189
188
len (tx .recipient ) == 0 ,
@@ -192,11 +191,13 @@ func (tx *Transaction) String() string {
192
191
tx .nonce ,
193
192
tx .gasPrice ,
194
193
tx .gas ,
195
- tx .Value ,
196
- tx .Data ,
194
+ tx .value ,
195
+ tx .data ,
197
196
tx .v ,
198
197
tx .r ,
199
- tx .s )
198
+ tx .s ,
199
+ ethutil .Encode (tx ),
200
+ )
200
201
}
201
202
202
203
// Transaction slice type for basic sorting
0 commit comments