Skip to content

Commit

Permalink
feat: update maxFee logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkelawala committed Oct 10, 2022
1 parent a1f3b38 commit 19add10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/account/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down Expand Up @@ -171,9 +171,9 @@ export class Account extends Provider implements AccountInterface {
transactionsDetail: InvocationsDetails = {}
): Promise<DeclareContractResponse> {
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(
Expand Down

0 comments on commit 19add10

Please sign in to comment.