Skip to content

Commit 49bd6da

Browse files
authored
fix(avm): gas computation in ts (#16692)
fixes private transaction fee computation
2 parents 260112e + b4cada3 commit 49bd6da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

yarn-project/simulator/src/public/public_processor/public_processor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { computeFeePayerBalanceLeafSlot, computeFeePayerBalanceStorageSlot } fro
1010
import { PublicDataWrite } from '@aztec/stdlib/avm';
1111
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
1212
import type { ContractDataSource } from '@aztec/stdlib/contract';
13+
import { computeTransactionFee } from '@aztec/stdlib/fees';
1314
import { Gas } from '@aztec/stdlib/gas';
1415
import type {
1516
MerkleTreeWriteOperations,
@@ -478,7 +479,7 @@ export class PublicProcessor implements Traceable {
478479
}))
479480
private async processPrivateOnlyTx(tx: Tx): Promise<[ProcessedTx, undefined]> {
480481
const gasFees = this.globalVariables.gasFees;
481-
const transactionFee = tx.data.gasUsed.computeFee(gasFees);
482+
const transactionFee = computeTransactionFee(gasFees, tx.data.constants.txContext.gasSettings, tx.data.gasUsed);
482483

483484
const feePaymentPublicDataWrite = await this.performFeePaymentPublicDataWrite(transactionFee, tx.data.feePayer);
484485

0 commit comments

Comments
 (0)