Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Prev Previous commit
Next Next commit
Add additional tests with different input types
  • Loading branch information
spacesailor24 committed Jul 23, 2021
commit 7472eb060175a29aaa6a4c10390022ebdcfa974a
148 changes: 113 additions & 35 deletions test/eth.feeHistory.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,123 @@
var BigNumber = require('bignumber.js');

var testMethod = require('./helpers/test.method.js');

var method = 'getFeeHistory';
var methodCall = 'eth_feeHistory';

var tests = [{
args: [4, "0xA30953", []],
formattedArgs: [4, "0xA30953", []],
result: {
"baseFeePerGas": [
"0xa",
"0x9",
"0x8",
"0x9",
"0x9"
],
"gasUsedRatio": [
0.003920375,
0.002625,
0.904999125,
0.348347625
],
"oldestBlock": 10684752
var tests = [
{
args: [4, "0xA30953", []],
formattedArgs: [4, "0xA30953", []],
result: {
"baseFeePerGas": [
"0xa",
"0x9",
"0x8",
"0x9",
"0x9"
],
"gasUsedRatio": [
0.003920375,
0.002625,
0.904999125,
0.348347625
],
"oldestBlock": 10684752
},
formattedResult: {
"baseFeePerGas": [
"0xa",
"0x9",
"0x8",
"0x9",
"0x9"
],
"gasUsedRatio": [
0.003920375,
0.002625,
0.904999125,
0.348347625
],
"oldestBlock": 10684752
},
call: methodCall
},
formattedResult: {
"baseFeePerGas": [
"0xa",
"0x9",
"0x8",
"0x9",
"0x9"
],
"gasUsedRatio": [
0.003920375,
0.002625,
0.904999125,
0.348347625
],
"oldestBlock": 10684752
{
args: ['0x4', 10684755, []],
formattedArgs: [4, "0xa30953", []],
result: {
"baseFeePerGas": [
"0xa",
"0x9",
"0x8",
"0x9",
"0x9"
],
"gasUsedRatio": [
0.003920375,
0.002625,
0.904999125,
0.348347625
],
"oldestBlock": 10684752
},
formattedResult: {
"baseFeePerGas": [
"0xa",
"0x9",
"0x8",
"0x9",
"0x9"
],
"gasUsedRatio": [
0.003920375,
0.002625,
0.904999125,
0.348347625
],
"oldestBlock": 10684752
},
call: methodCall
},
call: methodCall
}];
{
args: [new BigNumber(4), '10684755', []],
formattedArgs: [4, "0xa30953", []],
result: {
"baseFeePerGas": [
"0xa",
"0x9",
"0x8",
"0x9",
"0x9"
],
"gasUsedRatio": [
0.003920375,
0.002625,
0.904999125,
0.348347625
],
"oldestBlock": 10684752
},
formattedResult: {
"baseFeePerGas": [
"0xa",
"0x9",
"0x8",
"0x9",
"0x9"
],
"gasUsedRatio": [
0.003920375,
0.002625,
0.904999125,
0.348347625
],
"oldestBlock": 10684752
},
call: methodCall
}
];


testMethod.runTests('eth', method, tests);
Expand Down