rpc: implement eth_getPendingTransactions (#259)

* Implement `eth_getPendingTransactions`

Closes #244

* refactor repeatitive code

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* test UnwrapEthereumMsg

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
yihuang
2021-07-12 17:42:53 +00:00
committed by GitHub
co-authored by Federico Kunze Küllmer
parent 8d51a70d6d
commit 1a48e09e78
6 changed files with 138 additions and 110 deletions
+6
View File
@@ -282,6 +282,12 @@ func TestEth_Pending_GetTransactionByHash(t *testing.T) {
err = json.Unmarshal(rpcRes.Result, &pendingBlockTx)
require.NoError(t, err)
txsRes := Call(t, "eth_getPendingTransactions", []interface{}{})
var pendingTxs []map[string]interface{}
err = json.Unmarshal(txsRes.Result, &pendingTxs)
require.NoError(t, err)
require.NotEmpty(t, pendingTxs)
// verify the pending tx has all the correct fields from the tx sent.
require.NotEmpty(t, pendingBlockTx)
require.NotEmpty(t, pendingBlockTx["hash"])