From baf8c34dbc5de106fb34cfb94f4a25b652ce5a23 Mon Sep 17 00:00:00 2001 From: nigiri <168690269+0xnigir1@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:09:28 -0300 Subject: [PATCH] fix: pr comments --- .../src/allo/handlers/poolCreated.handler.ts | 10 ++++------ .../processors/src/strategy/common/base.strategy.ts | 2 ++ .../dvmdDirectTransfer.handler.ts | 9 ++++++++- .../handlers/registered.handler.ts | 12 ++++++++++++ .../src/strategy/strategyHandler.factory.ts | 1 - 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/packages/processors/src/allo/handlers/poolCreated.handler.ts b/packages/processors/src/allo/handlers/poolCreated.handler.ts index 2661237..eec68e4 100644 --- a/packages/processors/src/allo/handlers/poolCreated.handler.ts +++ b/packages/processors/src/allo/handlers/poolCreated.handler.ts @@ -67,8 +67,6 @@ export class PoolCreatedHandler implements IEventHandler<"Allo", "PoolCreated"> strategyId, ); - // const strategy = extractStrategyFromId(strategyId); - const token = getToken(this.chainId, matchTokenAddress); let strategyTimings: StrategyTimings = { @@ -78,7 +76,7 @@ export class PoolCreatedHandler implements IEventHandler<"Allo", "PoolCreated"> donationsEndTime: null, }; - let matchAmount = { + let matchAmountObj = { matchAmount: 0n, matchAmountInUsd: "0", }; @@ -86,7 +84,7 @@ export class PoolCreatedHandler implements IEventHandler<"Allo", "PoolCreated"> if (strategyHandler) { strategyTimings = await strategyHandler.fetchStrategyTimings(strategyAddress); if (parsedRoundMetadata.success && token) { - matchAmount = await strategyHandler.fetchMatchAmount( + matchAmountObj = await strategyHandler.fetchMatchAmount( Number(parsedRoundMetadata.data.quadraticFundingConfig.matchingFundsAvailable), token, this.event.blockTimestamp, @@ -117,8 +115,8 @@ export class PoolCreatedHandler implements IEventHandler<"Allo", "PoolCreated"> totalAmountDonatedInUsd: "0", uniqueDonorsCount: 0, matchTokenAddress, - matchAmount: matchAmount.matchAmount, - matchAmountInUsd: matchAmount.matchAmountInUsd, + matchAmount: matchAmountObj.matchAmount, + matchAmountInUsd: matchAmountObj.matchAmountInUsd, fundedAmount, fundedAmountInUsd, applicationMetadataCid: metadataPointer, diff --git a/packages/processors/src/strategy/common/base.strategy.ts b/packages/processors/src/strategy/common/base.strategy.ts index aaab7a8..eacefbf 100644 --- a/packages/processors/src/strategy/common/base.strategy.ts +++ b/packages/processors/src/strategy/common/base.strategy.ts @@ -17,6 +17,7 @@ export abstract class BaseStrategyHandler implements IStrategyHandler { return { applicationsStartTime: null, @@ -26,6 +27,7 @@ export abstract class BaseStrategyHandler implements IStrategyHandler; +/** + * Handles the Registered event for the Donation Voting Merkle Distribution Direct Transfer strategy. + * + * This handler performs the following core actions when a project registers for a round: + * - Validates that both the project and round exist + * - Decodes the application data from the event + * - Retrieves the application metadata + * - Creates a new application record with PENDING status + * - Links the application to both the project and round + */ + export class DVMDRegisteredHandler implements IEventHandler<"Strategy", "Registered"> { constructor( readonly event: ProtocolEvent<"Strategy", "Registered">, @@ -23,6 +34,7 @@ export class DVMDRegisteredHandler implements IEventHandler<"Strategy", "Registe private readonly dependencies: Dependencies, ) {} + /** @inheritdoc */ async handle(): Promise { const { projectRepository, roundRepository, metadataProvider } = this.dependencies; const { data: encodedData, recipientId, sender } = this.event.params; diff --git a/packages/processors/src/strategy/strategyHandler.factory.ts b/packages/processors/src/strategy/strategyHandler.factory.ts index b0d1253..7b466db 100644 --- a/packages/processors/src/strategy/strategyHandler.factory.ts +++ b/packages/processors/src/strategy/strategyHandler.factory.ts @@ -23,7 +23,6 @@ export class StrategyHandlerFactory { const _strategyId = strategyId.toLowerCase() as Hex; const StrategyHandlerClass = getHandler(_strategyId); - console.log("StrategyHandlerClass", StrategyHandlerClass); return StrategyHandlerClass ? new StrategyHandlerClass(chainId, dependencies) : undefined; } }