-
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: base strategy processor & dvmd strategy factory #16
Changes from all commits
fabe7e3
a180bf3
8dc11aa
72a6c5a
8c25428
baf8c34
5bd2d20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pnpm lint-staged && pnpm check-types | ||
pnpm lint-staged && pnpm check-types --force |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
export * from "./tokenPriceNotFound.exception.js"; | ||
export * from "./unsupportedEvent.exception.js"; | ||
export * from "./invalidArgument.exception.js"; | ||
export * from "./unsupportedStrategy.exception.js"; | ||
export * from "./projectNotFound.exception.js"; | ||
export * from "./roundNotFound.exception.js"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ChainId } from "@grants-stack-indexer/shared"; | ||
|
||
export class ProjectNotFound extends Error { | ||
constructor(chainId: ChainId, anchorAddress: string) { | ||
super(`Project not found for chainId: ${chainId} and anchorAddress: ${anchorAddress}`); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ChainId } from "@grants-stack-indexer/shared"; | ||
|
||
export class RoundNotFound extends Error { | ||
constructor(chainId: ChainId, strategyAddress: string) { | ||
super(`Round not found for chainId: ${chainId} and strategyAddress: ${strategyAddress}`); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Hex } from "viem"; | ||
|
||
export class UnsupportedStrategy extends Error { | ||
constructor(strategyId: Hex) { | ||
super(`Strategy ${strategyId} unsupported`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add some more context here, like the address ? Maybe this is correct and we should enrich the log once is bubbled up. wdyt? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mmm we can take EBO's error handling approach and a context object for errors. i think that with bubbling the event should be enough almost every time right? is the most generic context object There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤝 |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// Add your external exports here | ||
export { StrategyProcessor, AlloProcessor } from "./internal.js"; | ||
export type { IProcessor } from "./internal.js"; | ||
|
||
export { existsHandler } from "./internal.js"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./roles.js"; | ||
export * from "./utils.js"; | ||
export * from "./tokenMath.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.
hmm maybe worth naming the internal matchAmount something like matchAmountBigInt or maybe the outer matchAmount could be matchAmountObj?
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 like that