-
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: skip unsupported chains #45
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.
lgtmm
event: EboEvent<EboEventName>, | ||
): event is EboEvent<"RequestCreated"> => { | ||
return event.name === "RequestCreated"; | ||
}; |
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.
💎
if (this.isChainSupported(chainId)) { | ||
this.logger.info(`Creating a new EboActor to handle request ${requestId}...`); | ||
|
||
return this.createNewActor(firstEvent as EboEvent<"RequestCreated">); |
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.
return this.createNewActor(firstEvent as EboEvent<"RequestCreated">); | |
return this.createNewActor(firstEvent); |
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.
Whoops, nice catch! Wrote this before adding the typeguard
|
||
return this.createNewActor(firstEvent as EboEvent<"RequestCreated">); | ||
if (this.isChainSupported(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.
optional: could probably move this into the outer if { } to avoid nesting
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.
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) {
...
} ...
🤖 Linear
Closes GRT-144
Description