diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-20 23:09:44 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-20 23:09:44 +0800 |
commit | 4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0 (patch) | |
tree | d4622ae52bcc4c158aa26cf171a306979307bfc9 /ethchain/transaction.go | |
parent | 6efdd21633c1d21f36080754a89ad82c0c244128 (diff) | |
parent | c37b3cef7dc465832761b1da6761eeaa47e368d1 (diff) | |
download | go-tangerine-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar go-tangerine-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.gz go-tangerine-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.bz2 go-tangerine-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.lz go-tangerine-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.xz go-tangerine-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.zst go-tangerine-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.zip |
Merge branch 'release/poc5-rc7'
Diffstat (limited to 'ethchain/transaction.go')
-rw-r--r-- | ethchain/transaction.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ethchain/transaction.go b/ethchain/transaction.go index e93e610be..bd7a0e424 100644 --- a/ethchain/transaction.go +++ b/ethchain/transaction.go @@ -60,7 +60,7 @@ func (tx *Transaction) IsContract() bool { } func (tx *Transaction) CreationAddress() []byte { - return tx.Hash()[12:] + return ethutil.Sha3Bin(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce}).Encode())[12:] } func (tx *Transaction) Signature(key []byte) []byte { @@ -109,10 +109,8 @@ func (tx *Transaction) Sign(privk []byte) error { return nil } -// [ NONCE, VALUE, GASPRICE, GAS, TO, DATA, V, R, S ] -// [ NONCE, VALUE, GASPRICE, GAS, 0, CODE, INIT, V, R, S ] func (tx *Transaction) RlpData() interface{} { - data := []interface{}{tx.Nonce, tx.Value, tx.GasPrice, tx.Gas, tx.Recipient, tx.Data} + data := []interface{}{tx.Nonce, tx.GasPrice, tx.Gas, tx.Recipient, tx.Value, tx.Data} if tx.contractCreation { data = append(data, tx.Init) @@ -135,10 +133,10 @@ func (tx *Transaction) RlpDecode(data []byte) { func (tx *Transaction) RlpValueDecode(decoder *ethutil.Value) { tx.Nonce = decoder.Get(0).Uint() - tx.Value = decoder.Get(1).BigInt() - tx.GasPrice = decoder.Get(2).BigInt() - tx.Gas = decoder.Get(3).BigInt() - tx.Recipient = decoder.Get(4).Bytes() + tx.GasPrice = decoder.Get(1).BigInt() + tx.Gas = decoder.Get(2).BigInt() + tx.Recipient = decoder.Get(3).Bytes() + tx.Value = decoder.Get(4).BigInt() tx.Data = decoder.Get(5).Bytes() // If the list is of length 10 it's a contract creation tx |