diff --git a/package.json b/package.json index 17adc5b53..1feab26b7 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ }, "scripts": { "lint": "yarn prettier ./test/*.ts --check", + "lint:fix": "yarn prettier ./test/*.ts --write", "clean": "rimraf ./build/", "precompile": "yarn clean", "compile": "waffle .waffle.json", diff --git a/test/UniswapV2Factory.spec.ts b/test/UniswapV2Factory.spec.ts index 14cc73dd3..432aac353 100644 --- a/test/UniswapV2Factory.spec.ts +++ b/test/UniswapV2Factory.spec.ts @@ -66,8 +66,9 @@ describe('UniswapV2Factory', () => { }) it('createPair:gas', async () => { - const gasCost = await factory.estimate.createPair(...TEST_ADDRESSES) - expect(gasCost).to.eq(2512920) + const tx = await factory.createPair(...TEST_ADDRESSES) + const receipt = await tx.wait() + expect(receipt.gasUsed).to.eq(2512920) }) it('setFeeTo', async () => { diff --git a/test/UniswapV2Pair.spec.ts b/test/UniswapV2Pair.spec.ts index 3bd86ab4f..6258301c7 100644 --- a/test/UniswapV2Pair.spec.ts +++ b/test/UniswapV2Pair.spec.ts @@ -176,8 +176,9 @@ describe('UniswapV2Pair', () => { const expectedOutputAmount = bigNumberify('453305446940074565') await token1.transfer(pair.address, swapAmount) await mineBlock(provider, (await provider.getBlock('latest')).timestamp + 1) - const gasCost = await pair.estimate.swap(expectedOutputAmount, 0, wallet.address, '0x', overrides) - expect(gasCost).to.eq(79136) + const tx = await pair.swap(expectedOutputAmount, 0, wallet.address, '0x', overrides) + const receipt = await tx.wait() + expect(receipt.gasUsed).to.eq(73462) }) it('burn', async () => {