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

Network checks refactor #750

Merged
merged 7 commits into from
Aug 27, 2021
Merged

Network checks refactor #750

merged 7 commits into from
Aug 27, 2021

Conversation

TomAFrench
Copy link
Contributor

Description

Pulled out of #747

As we're supporting more networks I've refactored some of the checks for which network we're connected to so that they are more direct about what they're checking for (i.e. "does this network support EIP1559?" rather than "are we on mainnet?")

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

How should this be tested?

Check that GP and EIP1559 toggles doesn't turn up on unexpected networks

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code where relevant, particularly in hard-to-understand areas
  • My changes generate no new console warnings
  • The base of this PR is master if hotfix, develop if not

@vercel
Copy link

vercel bot commented Aug 27, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

kovan-app – ./

🔍 Inspect: https://vercel.com/balancer/kovan-app/9bc3cWDNjzyTBcxDGuZNsW5yyJ76
✅ Preview: Canceled

[Deployment in progress for 837fd51]

app – ./

🔍 Inspect: https://vercel.com/balancer/app/5fM14rZJR2PVUJvo5TS4pkSxJCL4
✅ Preview: Canceled

[Deployment for 837fd51 canceled]

staging-app – ./

🔍 Inspect: https://vercel.com/balancer/staging-app/73Y8SNxJYadkKAWoxE1MikPXERq9
✅ Preview: https://staging-app-git-network-checks-refactor-balancer.vercel.app

staging-kovan-app – ./

🔍 Inspect: https://vercel.com/balancer/staging-kovan-app/GcnPyKB8sUGhXH6sE3W82FgmogCp
✅ Preview: https://staging-kovan-app-git-network-checks-refactor-balancer.vercel.app

gnosis – ./

🔍 Inspect: https://vercel.com/balancer/gnosis/9kSuB6WHChSNKjJ3HUCzuitLV3vC
✅ Preview: https://gnosis-git-network-checks-refactor-balancer.vercel.app

[Deployment for 837fd51 canceled]

polygon – ./

🔍 Inspect: https://vercel.com/balancer/polygon/tWx1Y1XRbqqX464kT9z4edZpnNmN
✅ Preview: Canceled

[Deployment for 837fd51 canceled]

beta-polygon – ./

🔍 Inspect: https://vercel.com/balancer/beta-polygon/6CJe8qL76GPVSyuPQY35Ce2So8EZ
✅ Preview: https://beta-polygon-git-network-checks-refactor-balancer.vercel.app

beta-arbitrum – ./

🔍 Inspect: https://vercel.com/balancer/beta-arbitrum/41wM5tupvZAJ6sWskHgv3qJiXVWq
✅ Preview: https://beta-arbitrum-git-network-checks-refactor-balancer.vercel.app

[Deployment for 837fd51 canceled]

arbitrum – ./

🔍 Inspect: https://vercel.com/balancer/arbitrum/DRox65fPbNphZtv7WMuU3dDoVQRv
✅ Preview: https://arbitrum-git-network-checks-refactor-balancer.vercel.app

[Deployment for 837fd51 canceled]

Comment on lines 252 to 257
const isEIP1559SupportedNetwork = computed(
() => appNetworkConfig.supportsEIP1559
);
const isGnosisSupportedNetwork = computed(() =>
GP_SUPPORTED_NETWORKS.includes(chainId)
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

These should probably be defined in a relevant composable? Perhaps useWeb3 for isEIP1559SupportedNetwork and useGnosis for isGnosisSupportedNetwork

Copy link
Contributor Author

@TomAFrench TomAFrench Aug 27, 2021

Choose a reason for hiding this comment

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

I've moved isEIP1559SupportedNetwork to useWeb3. I'd like to do the same for isGnosisSupportedNetwork but we'd need to fill in all the other props it needs as well. Calling useGnosis seems to make the assumption that we're actively trying to trade through it which seems overkill for just checking whether we're on a supported network.

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.

2 participants