diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-25 21:13:54 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-25 21:13:54 +0800 |
commit | 81ef40010f6f31bc94f654048b41fa3a9f9e07eb (patch) | |
tree | 6ce0d9cd254a284fedf9abda8553374cc336e15b /ethchain/transaction.go | |
parent | 99fa9afaf15ceecffcc5b7051ffe9c7f0d179dec (diff) | |
download | dexon-81ef40010f6f31bc94f654048b41fa3a9f9e07eb.tar.gz dexon-81ef40010f6f31bc94f654048b41fa3a9f9e07eb.tar.zst dexon-81ef40010f6f31bc94f654048b41fa3a9f9e07eb.zip |
The body of contracts are now returned instead
Diffstat (limited to 'ethchain/transaction.go')
-rw-r--r-- | ethchain/transaction.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ethchain/transaction.go b/ethchain/transaction.go index 25d63879b..2c5615f99 100644 --- a/ethchain/transaction.go +++ b/ethchain/transaction.go @@ -57,10 +57,15 @@ func (tx *Transaction) Hash() []byte { return ethutil.Sha3Bin(ethutil.NewValue(data).Encode()) } -func (tx *Transaction) IsContract() bool { +func (tx *Transaction) CreatesContract() bool { return tx.contractCreation } +/* Depricated */ +func (tx *Transaction) IsContract() bool { + return tx.CreatesContract() +} + func (tx *Transaction) CreationAddress() []byte { return ethutil.Sha3Bin(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce}).Encode())[12:] } @@ -139,6 +144,9 @@ func (tx *Transaction) RlpValueDecode(decoder *ethutil.Value) { tx.v = byte(decoder.Get(6).Uint()) tx.r = decoder.Get(7).Bytes() tx.s = decoder.Get(8).Bytes() + if len(tx.Recipient) == 0 { + tx.contractCreation = true + } /* // If the list is of length 10 it's a contract creation tx @@ -173,7 +181,7 @@ func (tx *Transaction) String() string { S: 0x%x `, tx.Hash(), - len(tx.Recipient) == 1, + len(tx.Recipient) == 0, tx.Sender(), tx.Recipient, tx.Nonce, |