forked from cerc-io/plugeth
TxIndex -> Index
This commit is contained in:
parent
6bca40274f
commit
d465e410ef
@ -608,10 +608,10 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if args.TxIndex > int64(len(v.Transactions)) || args.TxIndex < 0 {
|
if args.Index > int64(len(v.Transactions)) || args.Index < 0 {
|
||||||
return NewErrorWithMessage(errDecodeArgs, "Transaction index does not exist")
|
return NewErrorWithMessage(errDecodeArgs, "Transaction index does not exist")
|
||||||
}
|
}
|
||||||
*reply = v.Transactions[args.TxIndex]
|
*reply = v.Transactions[args.Index]
|
||||||
case "eth_getTransactionByBlockNumberAndIndex":
|
case "eth_getTransactionByBlockNumberAndIndex":
|
||||||
args := new(BlockNumIndexArgs)
|
args := new(BlockNumIndexArgs)
|
||||||
if err := json.Unmarshal(req.Params, &args); err != nil {
|
if err := json.Unmarshal(req.Params, &args); err != nil {
|
||||||
@ -622,10 +622,10 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if args.TxIndex > int64(len(v.Transactions)) || args.TxIndex < 0 {
|
if args.Index > int64(len(v.Transactions)) || args.Index < 0 {
|
||||||
return NewErrorWithMessage(errDecodeArgs, "Transaction index does not exist")
|
return NewErrorWithMessage(errDecodeArgs, "Transaction index does not exist")
|
||||||
}
|
}
|
||||||
*reply = v.Transactions[args.TxIndex]
|
*reply = v.Transactions[args.Index]
|
||||||
case "eth_getUncleByBlockHashAndIndex":
|
case "eth_getUncleByBlockHashAndIndex":
|
||||||
case "eth_getUncleByBlockNumberAndIndex":
|
case "eth_getUncleByBlockNumberAndIndex":
|
||||||
return errNotImplemented
|
return errNotImplemented
|
||||||
|
@ -219,12 +219,12 @@ func (args *GetDataArgs) requirements() error {
|
|||||||
|
|
||||||
type BlockNumIndexArgs struct {
|
type BlockNumIndexArgs struct {
|
||||||
BlockNumber int64
|
BlockNumber int64
|
||||||
TxIndex int64
|
Index int64
|
||||||
}
|
}
|
||||||
|
|
||||||
type HashIndexArgs struct {
|
type HashIndexArgs struct {
|
||||||
BlockHash string
|
BlockHash string
|
||||||
TxIndex int64
|
Index int64
|
||||||
}
|
}
|
||||||
|
|
||||||
type Sha3Args struct {
|
type Sha3Args struct {
|
||||||
|
@ -2,6 +2,7 @@ package rpc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
// "fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
Loading…
Reference in New Issue
Block a user