Implement eth_sendTransaction (#104)

* Set up framework for sending transaction with correct args and nonce mutex locking

* Set up printing ethereum address through emintkeys and getting chainid from flags

* Implemented defaults for eth_sendTransaction

* Fix bug with no data provided

* Updated comments and error, as well as RLP encoded tx bytes for return instead of amino encoded
This commit is contained in:
Austin Abell
2019-09-20 09:30:20 -04:00
committed by GitHub
parent 2ca42cc155
commit 28aaba0695
8 changed files with 213 additions and 18 deletions
+22
View File
@@ -0,0 +1,22 @@
package args
import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
)
// SendTxArgs represents the arguments to sumbit a new transaction into the transaction pool.
// Duplicate struct definition since geth struct is in internal package
// Ref: https://github.com/ethereum/go-ethereum/blob/release/1.9/internal/ethapi/api.go#L1346
type SendTxArgs struct {
From common.Address `json:"from"`
To *common.Address `json:"to"`
Gas *hexutil.Uint64 `json:"gas"`
GasPrice *hexutil.Big `json:"gasPrice"`
Value *hexutil.Big `json:"value"`
Nonce *hexutil.Uint64 `json:"nonce"`
// We accept "data" and "input" for backwards-compatibility reasons. "input" is the
// newer name and should be preferred by clients.
Data *hexutil.Bytes `json:"data"`
Input *hexutil.Bytes `json:"input"`
}