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: add horizon accounting extension logic #53

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

jahabeebs
Copy link
Collaborator

🤖 Linear

Closes GRT-164

Description

  • Implements getApprovedModules (with an address parameter) and approveModule

Note that with the new error handling strategy we are just throwing the error if the transaction does not revert and we are not doing the .walk logic that we previously did with errors in ProtocolProvider

@jahabeebs jahabeebs self-assigned this Sep 26, 2024
Copy link

linear bot commented Sep 26, 2024

Copy link
Collaborator

@0xyaco 0xyaco left a comment

Choose a reason for hiding this comment

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

Just some minor comments

@@ -43,6 +43,7 @@ const protocolProviderConfigSchema = z.object({
epochManager: addressSchema,
eboRequestCreator: addressSchema,
bondEscalationModule: addressSchema,
horizonAccountingExtension: addressSchema,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh nice!

Mind adding an example address for this new field in apps/agent/config.example.yml?

Comment on lines 348 to 350
} catch (error) {
throw error;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to catch the error and just re-throw it? Could we skip the catch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can just skip the catch, I was just re-throwing because we were re-throwing in other methods in protocolProvider but we can just leave it out since eboActor will handle

try {
const approvedModules =
await this.horizonAccountingExtensionContract.read.approvedModules([user]);
return approvedModules.slice();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would be the same as [...approvedModules] right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep refactored to be more concise

Comment on lines 364 to 366
} catch (error) {
throw error;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same catch-throw comment as before

@jahabeebs jahabeebs requested a review from 0xyaco September 30, 2024 21:33
Copy link
Collaborator

@0xyaco 0xyaco left a comment

Choose a reason for hiding this comment

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

Cool!

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.

lgtm!

@jahabeebs jahabeebs merged commit f87030f into dev Oct 2, 2024
5 checks passed
@jahabeebs jahabeebs deleted the feat/grt-164-horizon-accounting-extension-rpcs branch October 2, 2024 18:44
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.

3 participants