Skip to content

Commit

Permalink
Add block range constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrl committed Jan 4, 2024
1 parent 5b98b4e commit 1e6d86d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/SpokeUtils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import assert from "assert";
import { getRelayHash } from "@across-protocol/contracts-v2/dist/test-utils";
import { BigNumber, Contract } from "ethers";
import { RelayData } from "../interfaces";
Expand Down Expand Up @@ -187,6 +188,7 @@ export async function findFillBlock(
): Promise<number | undefined> {
const { provider } = spokePool;
highBlockNumber ??= await provider.getBlockNumber();
assert(highBlockNumber > lowBlockNumber, `Block numbers out of range (${lowBlockNumber} > ${highBlockNumber})`);

// Make sure the relay is 100% completed within the block range supplied by the caller.
const [initialFillAmount, finalFillAmount] = await Promise.all([
Expand Down

0 comments on commit 1e6d86d

Please sign in to comment.