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: skip unsupported chains #45

Merged
merged 3 commits into from
Sep 18, 2024
Merged

feat: skip unsupported chains #45

merged 3 commits into from
Sep 18, 2024

Conversation

0xyaco
Copy link
Collaborator

@0xyaco 0xyaco commented Sep 17, 2024

🤖 Linear

Closes GRT-144

Description

  • Skip requests for chains that are not supported (also log a warning and send a notification)
  • Remove old staking related boilerplate that's not going to be used
  • Correct some deprecated epochs definitions inside tests

Copy link

linear bot commented Sep 17, 2024

0xnigir1
0xnigir1 previously approved these changes 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.

lgtmm

event: EboEvent<EboEventName>,
): event is EboEvent<"RequestCreated"> => {
return event.name === "RequestCreated";
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

💎

0xkenj1
0xkenj1 previously approved these changes Sep 17, 2024
if (this.isChainSupported(chainId)) {
this.logger.info(`Creating a new EboActor to handle request ${requestId}...`);

return this.createNewActor(firstEvent as EboEvent<"RequestCreated">);
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
return this.createNewActor(firstEvent as EboEvent<"RequestCreated">);
return this.createNewActor(firstEvent);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whoops, nice catch! Wrote this before adding the typeguard

jahabeebs
jahabeebs previously approved these changes Sep 17, 2024

return this.createNewActor(firstEvent as EboEvent<"RequestCreated">);
if (this.isChainSupported(chainId)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

optional: could probably move this into the outer if { } to avoid nesting

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It might be a little bit cumbersome for both supported and unsupported cases. I need to be sure first that the event is a RequestCreated event to access the chainId.

if (firstEvent && isRequestCreatedEvent(firstEvent) && this.isChainSupported(firstEvent.metadata.chainId)) {
  ...
} else if (firstEvent && isRequestCreatedEvent(firstEvent) && !this.isChainSupported(firstEvent.metadata.chainId) {
  ...
} ...

@0xyaco 0xyaco dismissed stale reviews from jahabeebs, 0xkenj1, and 0xnigir1 via 656c275 September 17, 2024 19:21
@0xyaco 0xyaco merged commit df23d45 into dev Sep 18, 2024
5 checks passed
@0xyaco 0xyaco deleted the feat/skip-unsupported-chains branch September 18, 2024 11:55
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