Skip to content

Commit

Permalink
test: fix eth_feeHistory assertion
Browse files Browse the repository at this point in the history
Signed-off-by: Ivo Yankov <[email protected]>
  • Loading branch information
Ivo-Yankov committed Jul 20, 2022
1 parent 8010039 commit 92c7735
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/server/tests/acceptance/rpc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1068,18 +1068,6 @@ describe('RPC Server Acceptance Tests', function () {
});
});

describe('eth_feeHistory', () => {
it('should call eth_feeHistory', async function () {
const res = await relay.call('eth_feeHistory', ['0x1', 'latest', null]);
expect(res.baseFeePerGas).to.exist.to.be.an('Array');
expect(res.baseFeePerGas.length).to.be.gt(0);
expect(res.gasUsedRatio).to.exist.to.be.an('Array');
expect(res.gasUsedRatio.length).to.be.gt(0);
expect(res.oldestBlock).to.exist;
expect(Number(res.oldestBlock)).to.be.gt(0);
});
});

// Only run the following tests against a local node since they only work with the genesis account
if (process.env.LOCAL_NODE && process.env.LOCAL_NODE !== 'false') {
describe('Gas Price related RPC endpoints', () => {
Expand Down Expand Up @@ -1139,5 +1127,17 @@ describe('RPC Server Acceptance Tests', function () {
});
});
}

describe('eth_feeHistory', () => {
it('should call eth_feeHistory', async function () {
const res = await relay.call('eth_feeHistory', ['0x1', 'latest', null]);
expect(res.baseFeePerGas).to.exist.to.be.an('Array');
expect(res.baseFeePerGas.length).to.be.gt(0);
expect(res.gasUsedRatio).to.exist.to.be.an('Array');
expect(res.gasUsedRatio.length).to.be.gt(0);
expect(res.oldestBlock).to.exist;
expect(Number(res.oldestBlock)).to.be.gt(0);
});
});
});
});

0 comments on commit 92c7735

Please sign in to comment.