aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/eth_args.go
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2015-06-24 19:53:37 +0800
committerBas van Kervel <bas@ethdev.com>2015-06-30 17:20:31 +0800
commit056e9dd393eeb7ddb4f6bf3e508228e1874bc94e (patch)
treef21087dbe1e6a955d22b96586a9b846d3471003f /rpc/api/eth_args.go
parent9226369b5daf8c1bf738369cd838963a5d58362d (diff)
downloadgo-tangerine-056e9dd393eeb7ddb4f6bf3e508228e1874bc94e.tar.gz
go-tangerine-056e9dd393eeb7ddb4f6bf3e508228e1874bc94e.tar.zst
go-tangerine-056e9dd393eeb7ddb4f6bf3e508228e1874bc94e.zip
added eth.pendingTransactions
Diffstat (limited to 'rpc/api/eth_args.go')
-rw-r--r--rpc/api/eth_args.go34
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(),
+ }
+}