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: Check if network is mainnet or testnet depending on env #936

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

ChaituVR
Copy link
Member

@ChaituVR ChaituVR commented Nov 10, 2023

  • Add a new keyword snapshotKeyword to check if the network exists in networks.json or not
  • If snapshot's env is mainnet it will check only mainnet networks
  • if snapshot's env is testnet it will check only testnet networks

To Do:

  • On UI and sequencer, need to update validateSchema function to pass the env in the third optional param
validateSchema(schema, data, { snapshotEnv: 'mainnet' })

@ChaituVR ChaituVR requested review from samuveth and wa0x6e November 10, 2023 11:14
keyword: 'snapshotNetwork',
validate: function (schema, data) {
// @ts-ignore
const snapshotEnv = this.snapshotEnv || 'default';
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't we default to mainnet ?

Copy link
Member Author

Choose a reason for hiding this comment

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

We now support all networks 🙈 so i thought it is the default case

we can change it later because,
If we make mainnet default, then we need to change the sequencer code before merging this, else demo.snapshot.org will also accept only mainnet networks
Also, UI still displays all networks.

Copy link
Contributor

Choose a reason for hiding this comment

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

So everything works like before, without the 3rd param ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep should work

Copy link
Contributor

@samuveth samuveth left a comment

Choose a reason for hiding this comment

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

utACK

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (6be303e) 44.19% compared to head (e9c4053) 44.96%.

Files Patch % Lines
src/utils.ts 94.44% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #936      +/-   ##
==========================================
+ Coverage   44.19%   44.96%   +0.76%     
==========================================
  Files          22       22              
  Lines        2100     2133      +33     
  Branches      195      200       +5     
==========================================
+ Hits          928      959      +31     
- Misses       1162     1164       +2     
  Partials       10       10              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChaituVR ChaituVR merged commit 7d30d83 into master Nov 16, 2023
4 checks passed
@ChaituVR ChaituVR deleted the feat-snapshot-network-keyword branch November 16, 2023 05:37
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.

3 participants