Skip to content

Commit

Permalink
add gas logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZumZoom committed Aug 9, 2024
1 parent efc6bc7 commit 83f032f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/FeeTaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe('FeeTaker', function () {
extension: order.extension,
});
const fillTx = swap.fillOrderArgs(order, r, vs, makingAmount, takerTraits.traits, takerTraits.args);
console.log(`GasUsed: ${(await (await fillTx).wait()).gasUsed.toString()}`);
await expect(fillTx).to.changeTokenBalances(dai, [addr, addr1], [makingAmount, -makingAmount]);
await expect(fillTx).to.changeTokenBalances(weth, [addr, addr1, addr2], [-takingAmount, takingAmount, 0]);
});
Expand Down Expand Up @@ -100,6 +101,7 @@ describe('FeeTaker', function () {
extension: order.extension,
});
const fillTx = swap.fillOrderArgs(order, r, vs, makingAmount, takerTraits.traits, takerTraits.args);
console.log(`GasUsed: ${(await (await fillTx).wait()).gasUsed.toString()}`);
await expect(fillTx).to.changeTokenBalances(dai, [addr, addr1], [makingAmount, -makingAmount]);
await expect(fillTx).to.changeTokenBalances(weth, [addr, addr1, addr2, addr3], [-takingAmount, 0, 0, takingAmount]);
});
Expand Down Expand Up @@ -253,6 +255,7 @@ describe('FeeTaker', function () {
extension: order.extension,
});
const fillTx = swap.fillOrderArgs(order, r, vs, makingAmount, takerTraits.traits, takerTraits.args);
console.log(`GasUsed: ${(await (await fillTx).wait()).gasUsed.toString()}`);
await expect(fillTx).to.changeTokenBalances(dai, [addr, addr1], [makingAmount, -makingAmount]);
await expect(fillTx).to.changeTokenBalances(weth, [addr, addr1, addr2, addr3], [-takingAmount - feeCalculated, 0, feeCalculated, takingAmount]);
});
Expand Down Expand Up @@ -297,6 +300,7 @@ describe('FeeTaker', function () {
extension: order.extension,
});
const fillTx = swap.fillOrderArgs(order, r, vs, makingAmount, takerTraits.traits, takerTraits.args);
console.log(`GasUsed: ${(await (await fillTx).wait()).gasUsed.toString()}`);
await expect(fillTx).to.changeTokenBalances(dai, [addr, addr1], [makingAmount, -makingAmount]);
await expect(fillTx).to.changeTokenBalance(weth, addr, -takingAmount - feeCalculated);
await expect(fillTx).to.changeEtherBalances([addr1, addr2], [takingAmount, feeCalculated]);
Expand Down Expand Up @@ -343,6 +347,7 @@ describe('FeeTaker', function () {
extension: order.extension,
});
const fillTx = swap.fillOrderArgs(order, r, vs, makingAmount, takerTraits.traits, takerTraits.args);
console.log(`GasUsed: ${(await (await fillTx).wait()).gasUsed.toString()}`);
await expect(fillTx).to.changeTokenBalances(dai, [addr, addr1], [makingAmount, -makingAmount]);
await expect(fillTx).to.changeTokenBalance(weth, addr, -takingAmount - feeCalculated);
await expect(fillTx).to.changeEtherBalances([addr1, addr2, addr3], [0, feeCalculated, takingAmount]);
Expand Down

0 comments on commit 83f032f

Please sign in to comment.