diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-18 22:33:22 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-18 22:33:22 +0800 |
commit | 5ad473d7581b92811c3a3e035274a82fc5568f57 (patch) | |
tree | 9d34ffc04b208a1923fa181938e7366bca2573d7 /core/types | |
parent | db494170dc819b1eb0d267b6e1ab36c6cfb63569 (diff) | |
download | go-tangerine-5ad473d7581b92811c3a3e035274a82fc5568f57.tar go-tangerine-5ad473d7581b92811c3a3e035274a82fc5568f57.tar.gz go-tangerine-5ad473d7581b92811c3a3e035274a82fc5568f57.tar.bz2 go-tangerine-5ad473d7581b92811c3a3e035274a82fc5568f57.tar.lz go-tangerine-5ad473d7581b92811c3a3e035274a82fc5568f57.tar.xz go-tangerine-5ad473d7581b92811c3a3e035274a82fc5568f57.tar.zst go-tangerine-5ad473d7581b92811c3a3e035274a82fc5568f57.zip |
Moved methods to messages
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/transaction.go | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go index 4b75d3abd..21d455f2e 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -9,11 +9,8 @@ import ( "github.com/obscuren/secp256k1-go" ) -var ContractAddr = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - func IsContractAddr(addr []byte) bool { return len(addr) == 0 - //return bytes.Compare(addr, ContractAddr) == 0 } type Transaction struct { @@ -25,17 +22,14 @@ type Transaction struct { data []byte v byte r, s []byte - - // Indicates whether this tx is a contract creation transaction - contractCreation bool } func NewContractCreationTx(value, gas, gasPrice *big.Int, script []byte) *Transaction { - return &Transaction{recipient: nil, value: value, gas: gas, gasPrice: gasPrice, data: script, contractCreation: true} + return &Transaction{recipient: nil, value: value, gas: gas, gasPrice: gasPrice, data: script} } func NewTransactionMessage(to []byte, value, gas, gasPrice *big.Int, data []byte) *Transaction { - return &Transaction{recipient: to, value: value, gasPrice: gasPrice, gas: gas, data: data, contractCreation: IsContractAddr(to)} + return &Transaction{recipient: to, value: value, gasPrice: gasPrice, gas: gas, data: data} } func NewTransactionFromBytes(data []byte) *Transaction { @@ -99,15 +93,6 @@ func (self *Transaction) To() []byte { return self.recipient } -func (tx *Transaction) CreatesContract() bool { - return tx.contractCreation -} - -/* Deprecated */ -func (tx *Transaction) IsContract() bool { - return tx.CreatesContract() -} - func (tx *Transaction) Curve() (v byte, r []byte, s []byte) { v = tx.v r = ethutil.LeftPadBytes(tx.r, 32) @@ -192,10 +177,6 @@ func (tx *Transaction) RlpValueDecode(decoder *ethutil.Value) { tx.r = decoder.Get(7).Bytes() tx.s = decoder.Get(8).Bytes() - - if IsContractAddr(tx.recipient) { - tx.contractCreation = true - } } func (tx *Transaction) String() string { |