Skip to content

Commit cbb04c3

Browse files
spalladinoclaude
andcommitted
fix(txe): return FEE_ORACLE_LAG entries from TXEFeeProvider
Addresses PR #22116 review comment 10: mock was returning a single-entry array instead of matching the production prediction window size. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5f7e700 commit cbb04c3

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

yarn-project/txe/src/state_machine/global_variable_builder.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
import { BlockNumber, type SlotNumber } from '@aztec/foundation/branded-types';
2+
import { times } from '@aztec/foundation/collection';
23
import type { EthAddress } from '@aztec/foundation/eth-address';
34
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4-
import { GasFees } from '@aztec/stdlib/gas';
5+
import { FEE_ORACLE_LAG, GasFees } from '@aztec/stdlib/gas';
56
import { makeGlobalVariables } from '@aztec/stdlib/testing';
67
import {
78
type BuildCheckpointGlobalVariablesOpts,
89
type CheckpointGlobalVariables,
10+
type FeeProvider,
911
type GlobalVariableBuilder,
1012
GlobalVariables,
1113
} from '@aztec/stdlib/tx';
1214

13-
export class TXEGlobalVariablesBuilder implements GlobalVariableBuilder {
15+
/** Simple FeeProvider for TXE that returns zero fees. */
16+
export class TXEFeeProvider implements FeeProvider {
1417
public getCurrentMinFees(): Promise<GasFees> {
1518
return Promise.resolve(new GasFees(0, 0));
1619
}
1720

1821
public getPredictedMinFees(): Promise<GasFees[]> {
19-
return Promise.resolve([new GasFees(0, 0)]);
22+
return Promise.resolve(times(FEE_ORACLE_LAG, () => new GasFees(0, 0)));
2023
}
24+
}
2125

26+
export class TXEGlobalVariablesBuilder implements GlobalVariableBuilder {
2227
public buildGlobalVariables(
2328
_blockNumber: BlockNumber,
2429
_coinbase: EthAddress,

0 commit comments

Comments
 (0)