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

Add a method to multipoolAutoSwap to return the pool brands #2810

Merged
merged 2 commits into from
Apr 6, 2021

Conversation

Chris-Hibbert
Copy link
Contributor

closes #2808

Add a method to multipoolAutoSwap to return the pool brands.

const getAllPoolBrands = () => {
const brands = [];
const allBrands = zcf.getTerms().brands;
for (const name of Object.getOwnPropertyNames(allBrands)) {
Copy link
Member

Choose a reason for hiding this comment

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

Better as a filter:

    return Object.getOwnPropertyNames(allBrands).filter(name => isSecondary(allBrands[name]);

Or if Object.values is allowed:

    return Object.values(allBrands).filter(isSecondary);

Copy link
Member

Choose a reason for hiding this comment

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

Not required though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. Thanks.

@Chris-Hibbert Chris-Hibbert enabled auto-merge (squash) April 6, 2021 16:44
@Chris-Hibbert Chris-Hibbert merged commit 16755d0 into master Apr 6, 2021
@Chris-Hibbert Chris-Hibbert deleted the enumeratePools-2808 branch April 6, 2021 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Zoe Contract Contracts within Zoe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoswap should report on what pools are available
2 participants