Skip to content

Commit

Permalink
remove debugging things
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKurt committed Jan 30, 2025
1 parent bd236da commit 4e01724
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/indexer/allo/roundMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const RoundMetadataSchema = z
quadraticFundingConfig: z
.object({
matchingFundsAvailable: z.number(),
})
.optional(),
}),
})
.passthrough();
32 changes: 28 additions & 4 deletions src/indexer/allo/v2/handleEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@ export async function handleEvent(

if (
parsedMetadata.success &&
token !== null &&
parsedMetadata.data.quadraticFundingConfig !== undefined
token !== null
) {
matchAmount = parseUnits(
parsedMetadata.data.quadraticFundingConfig.matchingFundsAvailable.toString(),
Expand Down Expand Up @@ -484,6 +483,22 @@ export async function handleEvent(
applicationsEndTime = getDateFromTimestamp(registrationEndTimeResolved);
donationsStartTime = getDateFromTimestamp(poolStartTimeResolved);
donationsEndTime = getDateFromTimestamp(poolEndTimeResolved);

if (parsedMetadata.success && token !== null) {
matchAmount = parseUnits(
parsedMetadata.data.quadraticFundingConfig.matchingFundsAvailable.toString(),
token.decimals
);
matchAmountInUsd = (
await convertToUSD(
priceProvider,
chainId,
matchTokenAddress,
matchAmount,
event.blockNumber
)
).amount;
}
}

const fundedAmount = event.params.amount;
Expand Down Expand Up @@ -546,6 +561,12 @@ export async function handleEvent(
},
];



// Admin roles for the pool are emitted before the pool is created
// so a pending round role is inserted in the db.
// Now that the PoolCreated event is emitted, we can convert
// pending roles to actual round roles.
const pendingAdminRoundRoles = await db.getPendingRoundRolesByRole(
chainId,
adminRole
Expand All @@ -571,6 +592,10 @@ export async function handleEvent(
});
}

// Manager roles for the pool are emitted before the pool is created
// so a pending round role is inserted in the db.
// Now that the PoolCreated event is emitted, we can convert
// pending roles to actual round roles.
const pendingManagerRoundRoles = await db.getPendingRoundRolesByRole(
chainId,
managerRole
Expand Down Expand Up @@ -799,8 +824,7 @@ export async function handleEvent(

if (
parsedMetadata.success &&
token !== null &&
parsedMetadata.data.quadraticFundingConfig !== undefined
token !== null
) {
matchAmount = parseUnits(
parsedMetadata.data.quadraticFundingConfig.matchingFundsAvailable.toString(),
Expand Down

0 comments on commit 4e01724

Please sign in to comment.