-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: all event handlers for allo contract #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice ser 🙌 , some smol comments but great job
|
||
async handle(): Promise<Changeset[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async handle(): Promise<Changeset[]> { | |
/* @inheritdoc */ | |
async handle(): Promise<Changeset[]> { |
if (!round) { | ||
return []; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess this was the original implementation but isn't it better to throw here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right
) {} | ||
|
||
async handle(): Promise<Changeset[]> { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're missing this configuration: https://eslint.org/docs/latest/rules/no-unused-vars#destructuredarrayignorepattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
if (!round) { | ||
logger.error(`Round not found for roundId: ${this.event.params.poolId.toString()}`); | ||
return []; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same doubt here
|
||
async handle(): Promise<Changeset[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async handle(): Promise<Changeset[]> { | |
/* @inheritdoc */ | |
async handle(): Promise<Changeset[]> { |
import { getToken } from "@grants-stack-indexer/shared"; | ||
|
||
import type { IEventHandler, ProcessorDependencies } from "../../../internal.js"; | ||
import { getTokenAmountInUsd } from "../../../helpers/pricing.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import from index.js
|
||
async handle(): Promise<Changeset[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async handle(): Promise<Changeset[]> { | |
/* @inheritdoc */ | |
async handle(): Promise<Changeset[]> { |
|
||
async handle(): Promise<Changeset[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async handle(): Promise<Changeset[]> { | |
/* @inheritdoc */ | |
async handle(): Promise<Changeset[]> { |
function createMockEvent( | ||
overrides: Partial<ProcessorEvent<"Allo", "PoolFunded">> = {}, | ||
): ProcessorEvent<"Allo", "PoolFunded"> { | ||
return { | ||
blockNumber: 116385567, | ||
blockTimestamp: 1708369911, | ||
chainId: 10 as ChainId, | ||
contractName: "Allo", | ||
eventName: "PoolFunded", | ||
logIndex: 123, | ||
srcAddress: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1", | ||
params: { | ||
poolId: "1", | ||
amount: "100", | ||
fee: "10", | ||
}, | ||
transactionFields: { | ||
hash: "0xtransactionhash", | ||
transactionIndex: 5, | ||
from: "0xsenderaddress", | ||
}, | ||
...overrides, | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a shared createMock
function in event.mock.ts
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will skip this, since is not that straight forward to implement it for Allo events, will add it as a low priority tech debt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly same comments as nigiri ^
]; | ||
} | ||
|
||
logger.warn(`No round found for role ${role} on chain ${this.chainId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed this file has a logger warn but the others don't--maybe want to add loggers to the others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, thats part of the issues to address from your feedback of the internal review
import { TokenPriceNotFoundError } from "../../../src/internal.js"; | ||
import { PoolMetadataUpdatedHandler } from "../../../src/processors/allo/handlers/index.js"; | ||
|
||
function createMockEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can extract these out into a common file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same answer as for nigiri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm (what a way to get back from retreat ser xd)
🤖 Linear
Closes GIT-137 GIT-149 GIT-150 GIT-151 GIT-152
Description
Added all the remaining handlers for Allo contract events.
Checklist before requesting a review