Skip to content

Commit

Permalink
🗃️ Use block number on read to maximise erpc caching for indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Oct 15, 2024
1 parent d0ac5e6 commit b75e6fb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ponder/src/campaign/campaignBank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ponder.on(
} as const,
],
allowFailure: false,
blockNumber: event.block.number,
});

await BankingContract.create({
Expand Down
1 change: 1 addition & 0 deletions packages/ponder/src/campaign/campaignCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ponder.on("CampaignsFactory:CampaignCreated", async ({ event, context }) => {
} as const,
],
allowFailure: true,
blockNumber: event.block.number,
});

if (
Expand Down
1 change: 1 addition & 0 deletions packages/ponder/src/campaign/campaignInteractionLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ponder.on("ProductInteraction:CampaignAttached", async ({ event, context }) => {
abi: interactionCampaignAbi,
address: event.args.campaign,
functionName: "getMetadata",
blockNumber: event.block.number,
});
const currentCampaign = Campaign.findUnique({ id: event.args.campaign });
if (!currentCampaign) {
Expand Down
1 change: 1 addition & 0 deletions packages/ponder/src/interactionDeployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ponder.on(
abi: productInteractionDiamondAbi,
address: event.args.interactionContract,
functionName: "getReferralTree",
blockNumber: event.block.number,
});

// Create the interaction contract
Expand Down
1 change: 1 addition & 0 deletions packages/ponder/src/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ponder.on("ProductRegistry:ProductMinted", async ({ event, context }) => {
functionName: "tokenURI",
address: context.contracts.ProductRegistry.address,
args: [event.args.productId],
blockNumber: event.block.number,
});

// Create the product
Expand Down

0 comments on commit b75e6fb

Please sign in to comment.