|
1 | 1 | import { BlockNumber, type SlotNumber } from '@aztec/foundation/branded-types'; |
| 2 | +import { times } from '@aztec/foundation/collection'; |
2 | 3 | import type { EthAddress } from '@aztec/foundation/eth-address'; |
3 | 4 | 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'; |
5 | 6 | import { makeGlobalVariables } from '@aztec/stdlib/testing'; |
6 | 7 | import { |
7 | 8 | type BuildCheckpointGlobalVariablesOpts, |
8 | 9 | type CheckpointGlobalVariables, |
| 10 | + type FeeProvider, |
9 | 11 | type GlobalVariableBuilder, |
10 | 12 | GlobalVariables, |
11 | 13 | } from '@aztec/stdlib/tx'; |
12 | 14 |
|
13 | | -export class TXEGlobalVariablesBuilder implements GlobalVariableBuilder { |
| 15 | +/** Simple FeeProvider for TXE that returns zero fees. */ |
| 16 | +export class TXEFeeProvider implements FeeProvider { |
14 | 17 | public getCurrentMinFees(): Promise<GasFees> { |
15 | 18 | return Promise.resolve(new GasFees(0, 0)); |
16 | 19 | } |
17 | 20 |
|
18 | 21 | public getPredictedMinFees(): Promise<GasFees[]> { |
19 | | - return Promise.resolve([new GasFees(0, 0)]); |
| 22 | + return Promise.resolve(times(FEE_ORACLE_LAG, () => new GasFees(0, 0))); |
20 | 23 | } |
| 24 | +} |
21 | 25 |
|
| 26 | +export class TXEGlobalVariablesBuilder implements GlobalVariableBuilder { |
22 | 27 | public buildGlobalVariables( |
23 | 28 | _blockNumber: BlockNumber, |
24 | 29 | _coinbase: EthAddress, |
|
0 commit comments