From cdd0f4607f023299dbbc232f77dc483539d45785 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 24 May 2024 21:07:08 -0700 Subject: [PATCH] Fix premature return bug in deployment delta tracking loop (#235) --- src/lib/gasData.ts | 4 ++-- test/integration/options.g.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/gasData.ts b/src/lib/gasData.ts index a1676e0..48deb1a 100644 --- a/src/lib/gasData.ts +++ b/src/lib/gasData.ts @@ -120,13 +120,13 @@ export class GasData { this._calculateDeltas(prevMethod, currentMethod); }); - for (const currentDeployment of this.deployments) { + this.deployments.forEach((currentDeployment) => { const prevDeployment = previousData.deployments.find((d)=> d.name === currentDeployment.name); if (!prevDeployment) return; this._calculateDeltas(prevDeployment, currentDeployment); - } + }) } /** diff --git a/test/integration/options.g.ts b/test/integration/options.g.ts index e26e8f7..8af2500 100644 --- a/test/integration/options.g.ts +++ b/test/integration/options.g.ts @@ -53,7 +53,7 @@ describe("Options G (Arbitrum with live pricing & `reportPureAndViewMethods`)", assert.isDefined(options.gasPrice); assert.isDefined(options.baseFeePerByte); assert.isBelow(options.gasPrice!, 1); - assert.isAbove(options.baseFeePerByte!, 0); + assert(options.baseFeePerByte! >= 0); // This is sometimes 0 ? assert.isDefined(options.tokenPrice); assert.isAbove(parseFloat(options.tokenPrice!), 1000); // Eth-ish