Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: across-protocol/indexer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eb6f00908a8bab9354b366ad2ea555f433563bec
Choose a base ref
..
head repository: across-protocol/indexer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f554034f0a5426b5ca09378000ed200447b16f2d
Choose a head ref
4 changes: 2 additions & 2 deletions packages/indexer/package.json
Original file line number Diff line number Diff line change
@@ -21,8 +21,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"@across-protocol/constants": "^3.1.13",
"@across-protocol/contracts": "^3.0.8",
"@across-protocol/constants": "^3.1.16",
"@across-protocol/contracts": "^3.0.11",
"@across-protocol/sdk": "^3.2.2",
"@types/lodash": "^4.17.7",
"bullmq": "^5.12.12",
3 changes: 2 additions & 1 deletion packages/indexer/src/services/HubPoolIndexerDataHandler.ts
Original file line number Diff line number Diff line change
@@ -96,9 +96,10 @@ export class HubPoolIndexerDataHandler implements IndexerDataHandler {
): Promise<FetchEventsResult> {
const { hubPoolClient, configStoreClient } = this;

hubPoolClient.firstBlockToSearch = blockRange.from;
configStoreClient.eventSearchConfig.toBlock = blockRange.to;
hubPoolClient.eventSearchConfig.fromBlock = blockRange.from;
hubPoolClient.eventSearchConfig.toBlock = blockRange.to;

await configStoreClient.update();
await hubPoolClient.update();
const proposedRootBundleEvents =
Original file line number Diff line number Diff line change
@@ -104,6 +104,7 @@ export class SpokePoolIndexerDataHandler implements IndexerDataHandler {
): Promise<FetchEventsResult> {
const { configStoreClient, hubPoolClient, spokePoolClient } = this;

spokePoolClient.firstBlockToSearch = blockRange.from;
spokePoolClient.eventSearchConfig.toBlock = blockRange.to;

await configStoreClient.update();
16 changes: 13 additions & 3 deletions packages/indexer/src/utils/contractUtils.ts
Original file line number Diff line number Diff line change
@@ -21,6 +21,16 @@ export type GetSpokeClientParams = {
hubPoolClient: across.clients.HubPoolClient;
};

function getAddress(contractName: string, chainId: number): string {
const address = getDeployedAddress(contractName, chainId);
if (!address) {
throw new Error(
`Address for contract ${contractName} on ${chainId} not found `,
);
}
return address;
}

/**
* Resolves a spoke pool client with the given parameters
* @param params Parameters to resolve a spoke client.
@@ -32,7 +42,7 @@ export function getSpokeClient(
params: GetSpokeClientParams,
): across.clients.SpokePoolClient {
const { provider, logger, maxBlockLookBack, chainId, hubPoolClient } = params;
const address = getDeployedAddress("SpokePool", chainId);
const address = getAddress("SpokePool", chainId);
const deployedBlockNumber = getDeployedBlockNumber("SpokePool", chainId);

const toBlock = params.toBlock;
@@ -85,7 +95,7 @@ export function getConfigStoreClient(
params: GetConfigStoreClientParams,
): across.clients.AcrossConfigStoreClient {
const { provider, logger, maxBlockLookBack, chainId } = params;
const address = getDeployedAddress("AcrossConfigStore", chainId);
const address = getAddress("AcrossConfigStore", chainId);
const deployedBlockNumber = getDeployedBlockNumber(
"AcrossConfigStore",
chainId,
@@ -131,7 +141,7 @@ export function getHubPoolClient(
): across.clients.HubPoolClient {
const { provider, logger, maxBlockLookBack, chainId, configStoreClient } =
params;
const address = getDeployedAddress("HubPool", chainId);
const address = getAddress("HubPool", chainId);
const deployedBlockNumber = getDeployedBlockNumber("HubPool", chainId);

const hubPoolContract = new Contract(address, HubPoolFactory.abi, provider);
Loading