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

oasis-node/cmd/stake: Make info subcommand tolerate invalid thresholds #2632

Merged
merged 2 commits into from
Feb 3, 2020

Conversation

tjanez
Copy link
Member

@tjanez tjanez commented Jan 31, 2020

No description provided.

@tjanez tjanez force-pushed the tjanez/staking-thresholds branch 2 times, most recently from 36a78af to bcb5e8e Compare January 31, 2020 15:39
@codecov
Copy link

codecov bot commented Jan 31, 2020

Codecov Report

Merging #2632 into master will increase coverage by 0.25%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2632      +/-   ##
==========================================
+ Coverage   63.04%   63.29%   +0.25%     
==========================================
  Files         360      360              
  Lines       34142    34153      +11     
==========================================
+ Hits        21524    21617      +93     
+ Misses       9966     9872      -94     
- Partials     2652     2664      +12
Impacted Files Coverage Δ
go/staking/api/api.go 61.76% <ø> (+14.7%) ⬆️
go/consensus/tendermint/apps/staking/query.go 74.28% <100%> (+5.71%) ⬆️
go/oasis-node/cmd/stake/stake.go 75.43% <100%> (+27.86%) ⬆️
go/runtime/committee/nodes.go 80.64% <0%> (-4.31%) ⬇️
go/storage/mkvs/urkel/syncer/proof.go 84.61% <0%> (-3.85%) ⬇️
go/runtime/client/client.go 65.51% <0%> (-1.54%) ⬇️
go/storage/mkvs/urkel/iterator.go 85.06% <0%> (-1.3%) ⬇️
go/common/grpc/grpc.go 77.59% <0%> (-1.25%) ⬇️
go/worker/compute/merge/committee/node.go 76.25% <0%> (+0.25%) ⬆️
go/consensus/tendermint/tendermint.go 65.96% <0%> (+0.41%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e22a8a...255b2f8. Read the comment docs.

Comment on lines +352 to +359
// Check that subcommand reported warnings for invalid staking threshold kinds.
subCmdOutput := b.String()
thresholdKinds := []string{"compute", "storage"}
for _, kind := range thresholdKinds {
if !strings.Contains(subCmdOutput, fmt.Sprintf("invalid staking threshold kind: %s", kind)) {
return fmt.Errorf("scenario/e2e/stake: querying common token info should warn about invalid staking threshold for kind: %s", kind)
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't know if this check is something we would want or is it testing a detail that is not important enough to be covered?

It replaces the ErrInvalidThreshold previously defined in
go/consensus/tendermint/apps/staking.
Change the subcommand to print valid staking threshold kinds and warn
about invalid ones.

Add test for info subcommand to the stake-cli End-to-End test.
@tjanez tjanez merged commit d1489f8 into master Feb 3, 2020
@tjanez tjanez deleted the tjanez/staking-thresholds branch February 3, 2020 09:16
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.

None yet

2 participants