Skip to content

Commit

Permalink
updating getFeeHistory input type (#4529)
Browse files Browse the repository at this point in the history
* updating getFeeHistory input type

* updating test cases

* adding PR number
  • Loading branch information
Alex authored Nov 15, 2021
1 parent 505b833 commit 2812172
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,3 +480,10 @@ Released with 1.0.0-beta.37 code base.

- Correct `web3.rst` example in documentation (#4511)
- Correct `BlockHeader` typing (`receiptRoot` -> `receiptsRoot`) (#4452)

## [1.7.0]

### Changed

- Changed getFeeHistory first parameter type from `number` to `hex` according to the [spec](https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=false&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false) (#4529)

2 changes: 1 addition & 1 deletion packages/web3-eth/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ var Eth = function Eth() {
name: 'getFeeHistory',
call: 'eth_feeHistory',
params: 3,
inputFormatter: [utils.toNumber, formatter.inputBlockNumberFormatter, null]
inputFormatter: [utils.numberToHex, formatter.inputBlockNumberFormatter, null]
}),
new Method({
name: 'getAccounts',
Expand Down
12 changes: 6 additions & 6 deletions test/eth.feeHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var methodCall = 'eth_feeHistory';
var tests = [
{
args: [4, "0xA30953", []],
formattedArgs: [4, "0xa30953", []],
formattedArgs: ['0x4', "0xa30953", []],
result: {
"baseFeePerGas": [
"0xa",
Expand Down Expand Up @@ -45,7 +45,7 @@ var tests = [
},
{
args: ['0x4', 10684755, []],
formattedArgs: [4, "0xa30953", []],
formattedArgs: ['0x4', "0xa30953", []],
result: {
"baseFeePerGas": [
"0xa",
Expand Down Expand Up @@ -82,7 +82,7 @@ var tests = [
},
{
args: [new BigNumber(4), '10684755', []],
formattedArgs: [4, "0xa30953", []],
formattedArgs: ["0x4", "0xa30953", []],
result: {
"baseFeePerGas": [
"0xa",
Expand Down Expand Up @@ -119,7 +119,7 @@ var tests = [
},
{
args: [4, 'latest', []],
formattedArgs: [4, 'latest', []],
formattedArgs: ["0x4", 'latest', []],
result: {
"baseFeePerGas": [
"0xa",
Expand Down Expand Up @@ -156,7 +156,7 @@ var tests = [
},
{
args: [4, 'earliest', []],
formattedArgs: [4, 'earliest', []],
formattedArgs: ["0x4", 'earliest', []],
result: {
"baseFeePerGas": [
"0xa",
Expand Down Expand Up @@ -193,7 +193,7 @@ var tests = [
},
{
args: [4, 'pending', []],
formattedArgs: [4, 'pending', []],
formattedArgs: ['0x4', 'pending', []],
result: {
"baseFeePerGas": [
"0xa",
Expand Down

0 comments on commit 2812172

Please sign in to comment.