Skip to content
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: check for accounting approval modules #44

Merged
merged 6 commits into from
Sep 20, 2024

Conversation

0xyaco
Copy link
Collaborator

@0xyaco 0xyaco commented Sep 17, 2024

🤖 Linear

Closes GRT-163

Description

  • Throws and fails the whole agent whenever there's at least one module pending approval

Copy link

linear bot commented Sep 17, 2024

Copy link
Collaborator

@0xnigir1 0xnigir1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a single comment, then is good for me 🫡

Comment on lines 80 to 82
const key = (isApproved ? "approved" : "notApproved") as keyof typeof summary;

summary[key] = { ...summary[key], [moduleName]: moduleAddress };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is as keyof typeof summary needed? isn't TS intelligent enough to narrow the type?

also doing smth like: summary[key][moduleName] = moduleAddress; seems cleaner to me, do we need to create a new object with the spread operator?

jahabeebs
jahabeebs previously approved these changes Sep 17, 2024
Copy link
Collaborator

@jahabeebs jahabeebs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

jahabeebs
jahabeebs previously approved these changes Sep 17, 2024
0xnigir1
0xnigir1 previously approved these changes Sep 17, 2024
@0xyaco 0xyaco dismissed stale reviews from 0xnigir1 and jahabeebs via ea3c9b2 September 18, 2024 12:19
Comment on lines 3 to 4
import { ProtocolProvider } from "@ebo-agent/automated-dispute/dist/providers/protocolProvider.js";
import { AccountingModules } from "@ebo-agent/automated-dispute/dist/types/prophet.js";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dist is pointing to the code that has been built ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥴

notApproved: {},
};

for (const [moduleName, moduleAddress] of Object.entries(this.accountingModules)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (const [moduleName, moduleAddress] of Object.entries(this.accountingModules)) {
for (const key in this.accountingModules) {

You can do it this way also, just to let you know, not requesting any changes here 🤣

@@ -3,11 +3,22 @@ import { BlockNumberService } from "@ebo-agent/blocknumber";
import { Caip2ChainId } from "@ebo-agent/blocknumber/dist/types.js";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn't in your PR but we should clean up these dist imports eventually

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally! Already did it in #49 's latest commit

@0xyaco 0xyaco merged commit 9e23424 into dev Sep 20, 2024
5 checks passed
@0xyaco 0xyaco deleted the feat/accounting-module-approval branch September 20, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants