From c25cbd4e6c0499f746f36d2fe33d08d25e3aa09a Mon Sep 17 00:00:00 2001 From: denis k Date: Fri, 24 Aug 2018 20:39:51 +1000 Subject: [PATCH] FIX: NewTransaction --- accounts/abi/bind/base.go | 2 +- core/types/transaction.go | 4 ++-- internal/ethapi/api.go | 2 +- signer/core/types.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 55093129a9..85b5c9f6d1 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -229,7 +229,7 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i if contract == nil { rawTx = types.NewContractCreation(nonce, value, gasLimit, gasPrice, input) } else { - rawTx = types.NewTransaction(nonce, c.address, value, gasLimit, gasPrice, input) + rawTx = types.NewTransaction(types.Binary, nonce, c.address, value, gasLimit, gasPrice, input) } if opts.Signer == nil { return nil, errors.New("no signer to authorize the transaction with") diff --git a/core/types/transaction.go b/core/types/transaction.go index ea75d1d668..d9ee6f07c4 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -106,8 +106,8 @@ func NewTransaction(txType TxType, nonce uint64, to common.Address, amount *big. return newTransaction(txType, nonce, &to, amount, gasLimit, gasPrice, data) } -func NewContractCreation(txType TxType, nonce uint64, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *Transaction { - return newTransaction(txType, nonce, nil, amount, gasLimit, gasPrice, data) +func NewContractCreation(nonce uint64, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *Transaction { + return newTransaction(Binary, nonce, nil, amount, gasLimit, gasPrice, data) } func newTransaction(txType TxType, nonce uint64, to *common.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *Transaction { diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 690a6a2865..64ec0653c9 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1172,7 +1172,7 @@ func (args *SendTxArgs) toTransaction() *types.Transaction { if args.To == nil { return types.NewContractCreation(uint64(*args.Nonce), (*big.Int)(args.Value), uint64(*args.Gas), (*big.Int)(args.GasPrice), input) } - return types.NewTransaction(uint64(*args.Nonce), *args.To, (*big.Int)(args.Value), uint64(*args.Gas), (*big.Int)(args.GasPrice), input) + return types.NewTransaction(types.Binary, uint64(*args.Nonce), *args.To, (*big.Int)(args.Value), uint64(*args.Gas), (*big.Int)(args.GasPrice), input) } // submitTransaction is a helper function that submits tx to txPool and logs a message. diff --git a/signer/core/types.go b/signer/core/types.go index ab4267ee68..799f38b7ee 100644 --- a/signer/core/types.go +++ b/signer/core/types.go @@ -91,5 +91,5 @@ func (args *SendTxArgs) toTransaction() *types.Transaction { if args.To == nil { return types.NewContractCreation(uint64(args.Nonce), (*big.Int)(&args.Value), uint64(args.Gas), (*big.Int)(&args.GasPrice), input) } - return types.NewTransaction(uint64(args.Nonce), args.To.Address(), (*big.Int)(&args.Value), (uint64)(args.Gas), (*big.Int)(&args.GasPrice), input) + return types.NewTransaction(types.Binary, uint64(args.Nonce), args.To.Address(), (*big.Int)(&args.Value), (uint64)(args.Gas), (*big.Int)(&args.GasPrice), input) }