Skip to content

Commit 6674394

Browse files
authored
test: Acceptance tests seems inconsistent (#430)
1 parent 9699699 commit 6674394

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/server/tests/acceptance/rpc.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,23 +1104,23 @@ describe('RPC Server Acceptance Tests', function () {
11041104
Assertions.feeHistory(res, {
11051105
resultCount: blockCountNumber,
11061106
oldestBlock: oldestBlockNumberHex,
1107-
chechReward: true
1107+
checkReward: true
11081108
});
1109-
1110-
expect(res.baseFeePerGas[0]).to.equal(datedGasPriceHex);
1109+
// We expect all values in the array to be from the mirror node. If there is discrepancy in the blocks, the first value is from the consensus node and it's different from expected.
1110+
expect(res.baseFeePerGas[1]).to.equal(datedGasPriceHex);
11111111
expect(res.baseFeePerGas[res.baseFeePerGas.length - 2]).to.equal(updatedGasPriceHex);
11121112
expect(res.baseFeePerGas[res.baseFeePerGas.length - 1]).to.equal(updatedGasPriceHex);
11131113
});
11141114

11151115
it('should call eth_feeHistory with newest block > latest', async function () {
11161116
let latestBlock;
1117-
const newestBlockNumber = lastBlockAfterUpdate.number + 10;
1118-
const newestBlockNumberHex = ethers.utils.hexValue(newestBlockNumber);
1117+
const blocksAhead = 10;
11191118
try {
11201119
latestBlock = (await mirrorNode.get(`/blocks?limit=1&order=desc`)).blocks[0];
1120+
const newestBlockNumberHex = ethers.utils.hexValue(latestBlock.number + blocksAhead);
11211121
await relay.call('eth_feeHistory', ['0x1', newestBlockNumberHex, null]);
11221122
} catch (error) {
1123-
Assertions.jsonRpcError(error, predefined.REQUEST_BEYOND_HEAD_BLOCK(newestBlockNumber, latestBlock.number));
1123+
Assertions.jsonRpcError(error, predefined.REQUEST_BEYOND_HEAD_BLOCK(latestBlock.number + blocksAhead, latestBlock.number));
11241124
}
11251125
});
11261126

0 commit comments

Comments
 (0)