Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: spypsy <spypsy@users.noreply.github.com>
  • Loading branch information
spalladino and spypsy authored Jan 21, 2025
1 parent 30baa4b commit 3b26253
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export abstract class BaseContractInteraction {
fee?.gasSettings?.maxFeesPerGas ?? (await this.wallet.getCurrentBaseFees()).mul(1 + (fee?.baseFeePadding ?? 0.5));
const paymentMethod = fee?.paymentMethod ?? new NoFeePaymentMethod();
const gasSettings: GasSettings = GasSettings.default({ ...fee?.gasSettings, maxFeesPerGas });
this.log.debug(`Using gas settings`, gasSettings);
this.log.debug(`Using L2 gas settings`, gasSettings);
return { gasSettings, paymentMethod };
}

Expand Down
6 changes: 3 additions & 3 deletions yarn-project/circuits.js/src/structs/gas_fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export class GasFees {
}

mul(scalar: number | bigint) {
if (typeof scalar === 'bigint') {
return new GasFees(new Fr(this.feePerDaGas.toBigInt() * scalar), new Fr(this.feePerL2Gas.toBigInt() * scalar));
} else if (scalar === 1) {
if (scalar === 1 || scalar === 1n) {
return this.clone();
} else if (typeof scalar === 'bigint') {
return new GasFees(new Fr(this.feePerDaGas.toBigInt() * scalar), new Fr(this.feePerL2Gas.toBigInt() * scalar));
} else {
return new GasFees(
new Fr(this.feePerDaGas.toNumberUnsafe() * scalar),
Expand Down

0 comments on commit 3b26253

Please sign in to comment.