Skip to content

Commit 5738b2d

Browse files
refactor(price_pusher): use nullish coalescing for gas price
Co-Authored-By: Ali Behjati <[email protected]>
1 parent 13e0eda commit 5738b2d

File tree

1 file changed

+5
-4
lines changed
  • apps/price_pusher/src/evm

1 file changed

+5
-4
lines changed

apps/price_pusher/src/evm/evm.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,11 @@ export class EvmPricePusher implements IPricePusher {
188188
// are using this to remain compatible with the networks that doesn't
189189
// support this transaction type.
190190
let gasPrice =
191-
this.gasPrice !== undefined
192-
? this.gasPrice
193-
: Number(await this.customGasStation?.getCustomGasPrice()) ||
194-
Number(await this.client.getGasPrice());
191+
this.gasPrice ??
192+
Number(
193+
await (this.customGasStation?.getCustomGasPrice() ??
194+
this.client.getGasPrice())
195+
);
195196

196197
// Try to re-use the same nonce and increase the gas if the last tx is not landed yet.
197198
if (this.pusherAddress === undefined) {

0 commit comments

Comments
 (0)