Commit c84d3450 authored by Georgios Konstantopoulos's avatar Georgios Konstantopoulos Committed by GitHub

test: adds test that gas estimation is deterministic (#962)

* test: adds test that gas estimation is deterministic

* chore: yarn lint
parent a25acbbd
......@@ -317,6 +317,22 @@ describe('Basic RPC tests', () => {
})
describe('eth_estimateGas (returns the fee)', () => {
it('gas estimation is deterministic', async () => {
let lastEstimate: BigNumber
for (let i = 0; i < 10; i++) {
const estimate = await l2Provider.estimateGas({
to: DEFAULT_TRANSACTION.to,
value: 0,
})
if (i > 0) {
expect(lastEstimate).to.be.eq(estimate)
}
lastEstimate = estimate
}
})
it('should return a gas estimate for txs with empty data', async () => {
const estimate = await l2Provider.estimateGas({
to: DEFAULT_TRANSACTION.to,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment