From 19add10d53b5b83fb96c8db1043318942f59309c Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Mon, 10 Oct 2022 16:14:42 +0530 Subject: [PATCH] feat: update maxFee logic --- src/account/default.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/account/default.ts b/src/account/default.ts index 91ac4ea5b..b71855f2b 100644 --- a/src/account/default.ts +++ b/src/account/default.ts @@ -134,7 +134,7 @@ export class Account extends Provider implements AccountInterface { const transactions = Array.isArray(calls) ? calls : [calls]; const nonce = toBN(transactionsDetail.nonce ?? (await this.getNonce())); let maxFee: BigNumberish = ZERO; - if (transactionsDetail.maxFee || transactionsDetail.maxFee === 0) { + if (transactionsDetail.maxFee) { maxFee = transactionsDetail.maxFee; } else { const { suggestedMaxFee } = await this.estimateInvokeFee(transactions, { nonce }); @@ -171,9 +171,9 @@ export class Account extends Provider implements AccountInterface { transactionsDetail: InvocationsDetails = {} ): Promise { const nonce = toBN(transactionsDetail.nonce ?? (await this.getNonce())); - let maxFee: BigNumberish = '0'; + let maxFee: BigNumberish = ZERO; - if (transactionsDetail.maxFee || transactionsDetail.maxFee === 0) { + if (transactionsDetail.maxFee) { maxFee = transactionsDetail.maxFee; } else { const { suggestedMaxFee } = await this.estimateDeclareFee(