diff options
author | Nick Savers <nicksavers@gmail.com> | 2014-05-20 19:02:37 +0800 |
---|---|---|
committer | Nick Savers <nicksavers@gmail.com> | 2014-05-20 19:02:37 +0800 |
commit | 530ab6b8fc9e7ea2b784dbd3f16d0272d227f6d6 (patch) | |
tree | 5446a33bd58d02772ce6758fbf296aac51edca26 | |
parent | fafdd21e4fb18c9714c4f784d443e9592ec3ff69 (diff) | |
download | go-tangerine-530ab6b8fc9e7ea2b784dbd3f16d0272d227f6d6.tar go-tangerine-530ab6b8fc9e7ea2b784dbd3f16d0272d227f6d6.tar.gz go-tangerine-530ab6b8fc9e7ea2b784dbd3f16d0272d227f6d6.tar.bz2 go-tangerine-530ab6b8fc9e7ea2b784dbd3f16d0272d227f6d6.tar.lz go-tangerine-530ab6b8fc9e7ea2b784dbd3f16d0272d227f6d6.tar.xz go-tangerine-530ab6b8fc9e7ea2b784dbd3f16d0272d227f6d6.tar.zst go-tangerine-530ab6b8fc9e7ea2b784dbd3f16d0272d227f6d6.zip |
Re-arranged transaction RLP encoding...
According to latest Yellow Paper specs and conform other clients
https://github.com/ethereum/latexpaper/commit/4794642e51ac1884e5e1af8a18ebc83aca115d64
-rw-r--r-- | ethchain/transaction.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ethchain/transaction.go b/ethchain/transaction.go index 8ea4704cb..c18ff7c53 100644 --- a/ethchain/transaction.go +++ b/ethchain/transaction.go @@ -109,10 +109,10 @@ 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 ] +// [ NONCE, GASPRICE, GAS, TO, VALUE, DATA, V, R, S ] +// [ NONCE, GASPRICE, GAS, 0, VALUE, 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 +135,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 |