-
Notifications
You must be signed in to change notification settings - Fork 369
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 unit tests and cli checks for validator hotfix interaction #2340
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2340 +/- ##
=======================================
Coverage 74.58% 74.58%
=======================================
Files 280 280
Lines 7912 7912
Branches 1016 1016
=======================================
Hits 5901 5901
Misses 1897 1897
Partials 114 114
Continue to review full report at Codecov.
|
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.
Left some comments
const governance = await this.kit.contracts.getGovernance() | ||
|
||
await newCheckBuilder(this) |
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.
you could also add the hotifixIsNotExecuted()
check
await newCheckBuilder(this, signer) | ||
.isVoteSignerOrAccount() | ||
.proposalExists(id) | ||
.proposalInStage(id, 'Referendum') |
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.
don't we have an enum for proposal stages, probably we should.. and we could use it here and on the other checks
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.
these strings are restricted to the keyof typeof ProposalStage
enum but I can import and use the properties as well
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.
the oclif input is also restricted to an enum already
packages/cli/src/utils/checks.ts
Outdated
this.addCheck( | ||
`${this.signer!} is vote signer or registered account`, | ||
this.withAccounts(async (accs) => { | ||
return accs.voteSignerToAccount(this.signer!).then(() => true, () => false) |
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.
are we doing this this.signer!
on the other checks? Looks like an easy way for a developer error.. since signer is an optional parameter on the newChecksBuilder
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.
yes, this pattern is already used in several places
…des/governance-cli-checks
297555f
to
4b2cd6a
Compare
* master: (30 commits) Fix coin colors (#2441) Make governance CLI more usable (#2428) Slashing params for stake off phase 2 (#2418) [Wallet] Rollback zeroSync toggle in case it was not successful (#2434) [Wallet] Cleanup unused StateProps references (#2439) Add unit tests and cli checks for validator hotfix interaction (#2340) Add proper Spanish translations (#2427) Catch exceptions during polling (#2432) Add unfreeze-contracts command to celotool (#2433) Fix verify-contracts file dependency missing (#2426) Upload correct bootnode IP address on internal testnet (#2402) [Wallet]: Historic Gold prices chart (#2345) Fix documentation link (#2404) Docs nits (#2424) Update genesis block accounts config to be correct for phase 2 (#2416) Sort on correct vote amount in validator election migration (#2417) Make attestation opt-in (#2230) Adjustment to home banner / mobile menu (#2408) Clarify documentation on validator proxy (#2371) [Slashing] Adding whitelist checks for onlySlasher to Validators.sol (#2347) ...
* master: (25 commits) Add react-testing-utils + Fix Analytics (#2437) collect coverage on web (#2415) Add callouts to serve text messages in regions (#2458) [Wallet] Historical currency conversions in the transaction feed (#2446) CLI relock fix (#2464) Update copyright year + inline button (#2468) Voting bot for stake off (#2327) Change order of profile info (#2454) [Wallet] Fix type check regression for components wrapped by our custom `withTranslation` (#2457) Unfreeze rewards by default (#2452) Baklava and baklavastaging deploys (#2421) Fix coin colors (#2441) Make governance CLI more usable (#2428) Slashing params for stake off phase 2 (#2418) [Wallet] Rollback zeroSync toggle in case it was not successful (#2434) [Wallet] Cleanup unused StateProps references (#2439) Add unit tests and cli checks for validator hotfix interaction (#2340) Add proper Spanish translations (#2427) Catch exceptions during polling (#2432) Add unfreeze-contracts command to celotool (#2433) ... # Conflicts: # packages/web/src/brandkit/common/MobileMenu.test.tsx # yarn.lock
Description
Adds unit tests and cli checks for validator hotfix interaction
Tested
packages/protocol/test/governance.ts
pacakages/cli/src/commands/governance
Other changes
authorizeValidatorSigner
toauthorizeValidatorSignerWithPublicKey
Related issues