-
Notifications
You must be signed in to change notification settings - Fork 24
feat: Add more functionalities to SpokePoolManager #1258
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
base: master
Are you sure you want to change the base?
Conversation
| */ | ||
| getSpokePoolAddresses(): (Address | undefined)[] { | ||
| return Object.values(this.spokePoolClients).map((client) => client.spokePoolAddress); | ||
| } |
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'm not sure how useful this is as an array because the address alone isn't very useful without the corresponding chainId. Might make sense to just return an Object mapping chainId to Address.
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.
| * @note This method returns all SpokePoolClient chainIds. | ||
| */ | ||
| getChainIds(): number[] { | ||
| return Object.keys(this.spokePoolClients).map(Number); |
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.
For this I prefer using the chainId member of the SpokePoolClient instance itself.
| return Object.keys(this.spokePoolClients).map(Number); | |
| return Object.values(this.spokePoolClients).map({ chainId } => 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.
I am okey with that, but is there case where that can be different?
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.
No description provided.