Skip to content

Commit

Permalink
[Core] Reset pending fees in plugin fee gas tests
Browse files Browse the repository at this point in the history
  • Loading branch information
debych committed Sep 6, 2024
1 parent 17c5046 commit fb34542
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/core/test/AlgebraPool.gas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ describe('AlgebraPool gas tests [ @skip-on-coverage ]', () => {
await poolPlugin.setPluginFees(0, 1000);
await pool.setPlugin(poolPlugin);
await pool.setPluginConfig(255);

await pool.advanceTime(86400);
await swapExact0For1(expandTo18Decimals(1), wallet.address);
await pool.advanceTime(1);
await swapToHigherPrice(startingPrice, wallet.address);
expect((await pool.globalState()).tick).to.eq(startingTick);
expect((await pool.globalState()).price).to.eq(startingPrice);
});

it('first swap in block with no tick movement, without transfer', async () => {
Expand Down
10 changes: 5 additions & 5 deletions src/core/test/__snapshots__/AlgebraPool.gas.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is off #swapExact1For0

exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is off #swapExact1For0 second swap in block with no tick movement 1`] = `103369`;

exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is off #swapExact1For0 with plugin fee on first swap in block moves tick, no initialized crossings, with transfer 1`] = `176475`;
exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is off #swapExact1For0 with plugin fee on first swap in block moves tick, no initialized crossings, with transfer 1`] = `157375`;

exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is off #swapExact1For0 with plugin fee on first swap in block with no tick movement, with transfer 1`] = `176423`;
exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is off #swapExact1For0 with plugin fee on first swap in block with no tick movement, with transfer 1`] = `157323`;

exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is off #swapExact1For0 with plugin fee on first swap in block with no tick movement, without transfer 1`] = `148985`;
exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is off #swapExact1For0 with plugin fee on first swap in block with no tick movement, without transfer 1`] = `131885`;

exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is on #burn above current price burn entire position after some time passes 1`] = `117084`;

Expand Down Expand Up @@ -186,8 +186,8 @@ exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is on #swapExact1For0 f

exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is on #swapExact1For0 second swap in block with no tick movement 1`] = `103606`;

exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is on #swapExact1For0 with plugin fee on first swap in block moves tick, no initialized crossings, with transfer 1`] = `187790`;
exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is on #swapExact1For0 with plugin fee on first swap in block moves tick, no initialized crossings, with transfer 1`] = `168690`;

exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is on #swapExact1For0 with plugin fee on first swap in block with no tick movement, with transfer 1`] = `187738`;
exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is on #swapExact1For0 with plugin fee on first swap in block with no tick movement, with transfer 1`] = `168638`;

exports[`AlgebraPool gas tests [ @skip-on-coverage ] fee is on #swapExact1For0 with plugin fee on first swap in block with no tick movement, without transfer 1`] = `135590`;

0 comments on commit fb34542

Please sign in to comment.