diff options
author | Maran <maran.hidskes@gmail.com> | 2014-03-24 17:24:39 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-03-24 17:24:39 +0800 |
commit | 97786d03d57e1ca79e34ce5fd9aa172c61c3e665 (patch) | |
tree | 251a5e54305e5cedf568f2fb73dbff9302df4185 /ethchain/transaction.go | |
parent | 274d5cc91c45349ec8d7a1f5a20ef29896b38b2e (diff) | |
parent | 6a86c517c4f4b372cad0ae1d92e926a482eac5ba (diff) | |
download | go-tangerine-97786d03d57e1ca79e34ce5fd9aa172c61c3e665.tar go-tangerine-97786d03d57e1ca79e34ce5fd9aa172c61c3e665.tar.gz go-tangerine-97786d03d57e1ca79e34ce5fd9aa172c61c3e665.tar.bz2 go-tangerine-97786d03d57e1ca79e34ce5fd9aa172c61c3e665.tar.lz go-tangerine-97786d03d57e1ca79e34ce5fd9aa172c61c3e665.tar.xz go-tangerine-97786d03d57e1ca79e34ce5fd9aa172c61c3e665.tar.zst go-tangerine-97786d03d57e1ca79e34ce5fd9aa172c61c3e665.zip |
Merge branch 'master' into miner
Diffstat (limited to 'ethchain/transaction.go')
-rw-r--r-- | ethchain/transaction.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/ethchain/transaction.go b/ethchain/transaction.go index 57df9cdc4..3b07c81d4 100644 --- a/ethchain/transaction.go +++ b/ethchain/transaction.go @@ -13,22 +13,31 @@ type Transaction struct { Nonce uint64 Recipient []byte Value *big.Int + Gas *big.Int + Gasprice *big.Int Data []string - Memory []int v byte r, s []byte } func NewTransaction(to []byte, value *big.Int, data []string) *Transaction { - tx := Transaction{Recipient: to, Value: value} - tx.Nonce = 0 - - // Serialize the data - tx.Data = data + tx := Transaction{Recipient: to, Value: value, Nonce: 0, Data: data} return &tx } +func NewContractCreationTx(value, gasprice *big.Int, data []string) *Transaction { + return &Transaction{Value: value, Gasprice: gasprice, Data: data} +} + +func NewContractMessageTx(to []byte, value, gasprice, gas *big.Int, data []string) *Transaction { + return &Transaction{Recipient: to, Value: value, Gasprice: gasprice, Gas: gas, Data: data} +} + +func NewTx(to []byte, value *big.Int, data []string) *Transaction { + return &Transaction{Recipient: to, Value: value, Gasprice: big.NewInt(0), Gas: big.NewInt(0), Nonce: 0, Data: data} +} + // XXX Deprecated func NewTransactionFromData(data []byte) *Transaction { return NewTransactionFromBytes(data) |