diff options
author | Bas van Kervel <bas@ethdev.com> | 2015-06-24 19:53:37 +0800 |
---|---|---|
committer | Bas van Kervel <bas@ethdev.com> | 2015-06-24 19:53:37 +0800 |
commit | f1a4a6e563ea72affe365d89513e5c83a35e4c28 (patch) | |
tree | a1c5f9685fd1e3cc0e21799e74c5ef216a1a9f0e /rpc/api/eth_args.go | |
parent | 22c7ce0162f2d14a7340e00e93697780c91d2087 (diff) | |
download | go-tangerine-f1a4a6e563ea72affe365d89513e5c83a35e4c28.tar go-tangerine-f1a4a6e563ea72affe365d89513e5c83a35e4c28.tar.gz go-tangerine-f1a4a6e563ea72affe365d89513e5c83a35e4c28.tar.bz2 go-tangerine-f1a4a6e563ea72affe365d89513e5c83a35e4c28.tar.lz go-tangerine-f1a4a6e563ea72affe365d89513e5c83a35e4c28.tar.xz go-tangerine-f1a4a6e563ea72affe365d89513e5c83a35e4c28.tar.zst go-tangerine-f1a4a6e563ea72affe365d89513e5c83a35e4c28.zip |
added eth.pendingTransactions
Diffstat (limited to 'rpc/api/eth_args.go')
-rw-r--r-- | rpc/api/eth_args.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/rpc/api/eth_args.go b/rpc/api/eth_args.go index bf8ffead6..39c003f66 100644 --- a/rpc/api/eth_args.go +++ b/rpc/api/eth_args.go @@ -5,8 +5,11 @@ import ( "fmt" "math/big" + "strconv" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc/shared" ) @@ -858,3 +861,34 @@ func (args *SubmitWorkArgs) UnmarshalJSON(b []byte) (err error) { return nil } + +type tx struct { + tx *types.Transaction + + To string + From string + Nonce string + Value string + Data string + GasLimit string + GasPrice string +} + +func newTx(t *types.Transaction) *tx { + from, _ := t.From() + var to string + if t := t.To(); t != nil { + to = t.Hex() + } + + return &tx{ + tx: t, + To: to, + From: from.Hex(), + Value: t.Amount.String(), + Nonce: strconv.Itoa(int(t.Nonce())), + Data: "0x" + common.Bytes2Hex(t.Data()), + GasLimit: t.GasLimit.String(), + GasPrice: t.GasPrice().String(), + } +} |