Test and fix eth_FeeHistory
This commit is contained in:
parent
c0c8ad5510
commit
8daf22c3ff
@ -433,7 +433,7 @@ func (h EthHash) ToCid() cid.Cid {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type EthFeeHistory struct {
|
type EthFeeHistory struct {
|
||||||
OldestBlock uint64 `json:"oldestBlock"`
|
OldestBlock EthUint64 `json:"oldestBlock"`
|
||||||
BaseFeePerGas []EthBigInt `json:"baseFeePerGas"`
|
BaseFeePerGas []EthBigInt `json:"baseFeePerGas"`
|
||||||
GasUsedRatio []float64 `json:"gasUsedRatio"`
|
GasUsedRatio []float64 `json:"gasUsedRatio"`
|
||||||
Reward *[][]EthBigInt `json:"reward,omitempty"`
|
Reward *[][]EthBigInt `json:"reward,omitempty"`
|
||||||
|
@ -398,15 +398,22 @@ func TestEthOpenRPCConformance(t *testing.T) {
|
|||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
|
|
||||||
// {
|
{
|
||||||
// method: "eth_estimateGas",
|
method: "eth_estimateGas",
|
||||||
// call: func(a *ethAPIRaw) (json.RawMessage, error) {
|
call: func(a *ethAPIRaw) (json.RawMessage, error) {
|
||||||
// return ethapi.EthEstimateGas(context.Background(), ethtypes.EthCall{
|
return ethapi.EthEstimateGas(context.Background(), ethtypes.EthCall{
|
||||||
// From: &senderEthAddr,
|
From: ðAddr,
|
||||||
// Data: contractBin,
|
Data: contractBin,
|
||||||
// })
|
})
|
||||||
// },
|
},
|
||||||
// },
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
method: "eth_feeHistory",
|
||||||
|
call: func(a *ethAPIRaw) (json.RawMessage, error) {
|
||||||
|
return ethapi.EthFeeHistory(context.Background(), ethtypes.EthUint64(2), "", nil)
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
@ -640,7 +640,7 @@ func (a *EthModule) EthFeeHistory(ctx context.Context, blkCount ethtypes.EthUint
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ethtypes.EthFeeHistory{
|
return ethtypes.EthFeeHistory{
|
||||||
OldestBlock: oldestBlkHeight,
|
OldestBlock: ethtypes.EthUint64(oldestBlkHeight),
|
||||||
BaseFeePerGas: baseFeeArray,
|
BaseFeePerGas: baseFeeArray,
|
||||||
GasUsedRatio: gasUsedRatioArray,
|
GasUsedRatio: gasUsedRatioArray,
|
||||||
}, nil
|
}, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user