@@ -9,11 +9,8 @@ import (
9
9
"github.com/obscuren/secp256k1-go"
10
10
)
11
11
12
- var ContractAddr = []byte {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
13
-
14
12
func IsContractAddr (addr []byte ) bool {
15
13
return len (addr ) == 0
16
- //return bytes.Compare(addr, ContractAddr) == 0
17
14
}
18
15
19
16
type Transaction struct {
@@ -25,17 +22,14 @@ type Transaction struct {
25
22
data []byte
26
23
v byte
27
24
r , s []byte
28
-
29
- // Indicates whether this tx is a contract creation transaction
30
- contractCreation bool
31
25
}
32
26
33
27
func NewContractCreationTx (value , gas , gasPrice * big.Int , script []byte ) * Transaction {
34
- return & Transaction {recipient : nil , value : value , gas : gas , gasPrice : gasPrice , data : script , contractCreation : true }
28
+ return & Transaction {recipient : nil , value : value , gas : gas , gasPrice : gasPrice , data : script }
35
29
}
36
30
37
31
func NewTransactionMessage (to []byte , value , gas , gasPrice * big.Int , data []byte ) * Transaction {
38
- return & Transaction {recipient : to , value : value , gasPrice : gasPrice , gas : gas , data : data , contractCreation : IsContractAddr ( to ) }
32
+ return & Transaction {recipient : to , value : value , gasPrice : gasPrice , gas : gas , data : data }
39
33
}
40
34
41
35
func NewTransactionFromBytes (data []byte ) * Transaction {
@@ -99,15 +93,6 @@ func (self *Transaction) To() []byte {
99
93
return self .recipient
100
94
}
101
95
102
- func (tx * Transaction ) CreatesContract () bool {
103
- return tx .contractCreation
104
- }
105
-
106
- /* Deprecated */
107
- func (tx * Transaction ) IsContract () bool {
108
- return tx .CreatesContract ()
109
- }
110
-
111
96
func (tx * Transaction ) Curve () (v byte , r []byte , s []byte ) {
112
97
v = tx .v
113
98
r = ethutil .LeftPadBytes (tx .r , 32 )
@@ -192,10 +177,6 @@ func (tx *Transaction) RlpValueDecode(decoder *ethutil.Value) {
192
177
193
178
tx .r = decoder .Get (7 ).Bytes ()
194
179
tx .s = decoder .Get (8 ).Bytes ()
195
-
196
- if IsContractAddr (tx .recipient ) {
197
- tx .contractCreation = true
198
- }
199
180
}
200
181
201
182
func (tx * Transaction ) String () string {
0 commit comments