Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions yarn-project/aztec.js/src/test/anvil_test_watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ export class AnvilTestWatcher {
const isAutoMining = await this.cheatcodes.isAutoMining();

if (isAutoMining) {
this.filledRunningPromise = new RunningPromise(() => this.warpTimeIfNeeded(), this.logger, 1000);
this.filledRunningPromise = new RunningPromise(() => this.warpTimeIfNeeded(), this.logger, 200);
this.filledRunningPromise.start();
this.mineIfOutdatedPromise = new RunningPromise(() => this.mineIfOutdated(), this.logger, 1000);
this.mineIfOutdatedPromise = new RunningPromise(() => this.mineIfOutdated(), this.logger, 200);
this.mineIfOutdatedPromise.start();
this.markingAsProvenRunningPromise = new RunningPromise(() => this.markAsProven(), this.logger, 1000);
this.markingAsProvenRunningPromise = new RunningPromise(() => this.markAsProven(), this.logger, 200);
this.markingAsProvenRunningPromise.start();
this.logger.info(`Watcher started for rollup at ${this.rollup.address}`);
} else {
Expand All @@ -88,6 +88,12 @@ export class AnvilTestWatcher {
await this.markingAsProvenRunningPromise?.stop();
}

async trigger() {
await this.filledRunningPromise?.trigger();
await this.mineIfOutdatedPromise?.trigger();
await this.markingAsProvenRunningPromise?.trigger();
}

async markAsProven() {
if (!this.isMarkingAsProven) {
return;
Expand Down
3 changes: 3 additions & 0 deletions yarn-project/end-to-end/src/e2e_fees/failures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('e2e_fees failures', () => {

// Prove up until the current state by just marking it as proven.
// Then turn off the watcher to prevent it from keep proving
await t.context.watcher.trigger();
await t.cheatCodes.rollup.advanceToNextEpoch();
await t.catchUpProvenChain();
t.setIsMarkingAsProven(false);
Expand Down Expand Up @@ -77,6 +78,7 @@ describe('e2e_fees failures', () => {
await expectMapping(t.getGasBalanceFn, [aliceAddress, bananaFPC.address], [initialAliceGas, initialFPCGas]);

// We wait until the proven chain is caught up so all previous fees are paid out.
await t.context.watcher.trigger();
await t.cheatCodes.rollup.advanceToNextEpoch();
await t.catchUpProvenChain();

Expand All @@ -97,6 +99,7 @@ describe('e2e_fees failures', () => {

// @note There is a potential race condition here if other tests send transactions that get into the same
// epoch and thereby pays out fees at the same time (when proven).
await t.context.watcher.trigger();
await t.cheatCodes.rollup.advanceToNextEpoch();
await t.catchUpProvenChain();

Expand Down