Skip to content

Commit e9649ad

Browse files
committed
prettier fixes
1 parent 9e422a6 commit e9649ad

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

apps/price_pusher/src/evm/command.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export default {
8282
type: "number",
8383
required: false,
8484
default: 1,
85-
} as Options, "disable-push": {
85+
} as Options,
86+
"disable-push": {
8687
description: "Dry run without pushing",
8788
type: "boolean",
8889
required: false,

apps/price_pusher/src/evm/evm.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ export class EvmPricePusher implements IPricePusher {
196196
this.gasPrice ??
197197
Number(
198198
await (this.customGasStation?.getCustomGasPrice() ??
199-
(this.useRecentGasPriceEstimate
200-
? this.getMedianRecentGasPrice()
201-
: this.client.getGasPrice())),
199+
(this.useRecentGasPriceEstimate
200+
? this.getMedianRecentGasPrice()
201+
: this.client.getGasPrice())),
202202
);
203203
this.metrics?.updateGasPrice(this.network, gasPrice);
204204

@@ -443,18 +443,20 @@ export class EvmPricePusher implements IPricePusher {
443443
});
444444
this.logger.info({ baseFeePerGas, reward }, "feeHistory");
445445
// remove the next block base fee
446-
const trimmedBaseFees = baseFeePerGas.slice(0, -1)
446+
const trimmedBaseFees = baseFeePerGas.slice(0, -1);
447447
const gasPrices = trimmedBaseFees.map((base, i) => {
448448
const medianTip = reward?.[i]?.[0] ?? 0n;
449449
return base + medianTip;
450-
})
451-
this.logger.info({gasPrices}, "gasPrices:");
450+
});
451+
this.logger.info({ gasPrices }, "gasPrices:");
452452

453453
if (gasPrices.length === 0) {
454454
return 0n;
455455
} else {
456-
const sorted = [...gasPrices].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
457-
const medianIndex = Math.floor(sorted.length / 2)
456+
const sorted = [...gasPrices].sort((a, b) =>
457+
a < b ? -1 : a > b ? 1 : 0,
458+
);
459+
const medianIndex = Math.floor(sorted.length / 2);
458460
const medianPrice = sorted[medianIndex];
459461
this.logger.info({ medianPrice }, "medianPrice:");
460462
return medianPrice;

apps/price_pusher/src/metrics.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,11 @@ export class PricePusherMetrics {
222222
);
223223
}
224224

225-
public updateGasPrice(
226-
network: string,
227-
gasPrice: bigint | number,
228-
): void {
225+
public updateGasPrice(network: string, gasPrice: bigint | number): void {
229226
// Convert to number for compatibility with prometheus
230227
const gasPriceNum =
231-
typeof gasPrice === "bigint" ? Number(gasPrice) : gasPrice;
232-
this.gasPrice.set(
233-
{ network },
234-
gasPriceNum,
235-
);
236-
this.logger.debug(
237-
`Updated gas price metric: ${network} = ${gasPriceNum}`,
238-
);
228+
typeof gasPrice === "bigint" ? Number(gasPrice) : gasPrice;
229+
this.gasPrice.set({ network }, gasPriceNum);
230+
this.logger.debug(`Updated gas price metric: ${network} = ${gasPriceNum}`);
239231
}
240232
}

0 commit comments

Comments
 (0)