Skip to content

Commit

Permalink
fix: snapshot for each batch in optimistic
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Aug 9, 2024
1 parent 1efc156 commit 991a13f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/services/liquidate/BatchLiquidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default class BatchLiquidator
this.logger.debug(
`processing batch of ${batch.length} for ${batch[0]?.cmName}: ${batch.map(ca => ca.addr)}`,
);
const snapshotId = await this.client.anvil.snapshot();
const { results, receipt } = await this.#liquidateBatch(
batch,
cms,
Expand All @@ -99,6 +100,7 @@ export default class BatchLiquidator
for (const r of results) {
this.optimistic.push({ ...r, traceFile: traceId });
}
await this.client.anvil.revert({ id: snapshotId });
}
const success = this.optimistic.get().filter(r => !r.isError).length;
this.logger.info(
Expand Down

0 comments on commit 991a13f

Please sign in to comment.