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

chore: Add 0 or positive check for minimum number of witnesses required. #1026

Merged
merged 1 commit into from
Jan 17, 2022

Conversation

sandrask
Copy link
Contributor

Currently for minimum number of witnesses in witness policy rule OutOf() we only check for integer for first parameter. It should be 0 or positive integer since it denotes minimum number of witnesses required to satisfy policy.

Percent rule MinPercent() is already enforcing integer that is between 0 and 100 which is correct for percent.

Closes #1025

Signed-off-by: Sandra Vrtikapa sandra.vrtikapa@securekey.com

Currently for minimum number of witnesses in witness policy rule OutOf() we only check for integer for first parameter. It should be 0 or positive integer since it denotes minimum number of witnesses required to satisfy policy.

Percent rule MinPercent() is already enforcing integer that is between 0 and 100 which is correct for percent.

Closes trustbloc#1025

Signed-off-by: Sandra Vrtikapa <sandra.vrtikapa@securekey.com>
@cla-bot cla-bot bot added the cla-signed label Jan 14, 2022
@codecov
Copy link

codecov bot commented Jan 14, 2022

Codecov Report

Merging #1026 (b147b0e) into main (dd5b0bf) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1026      +/-   ##
==========================================
+ Coverage   89.31%   89.35%   +0.03%     
==========================================
  Files         160      160              
  Lines       15530    15596      +66     
==========================================
+ Hits        13871    13936      +65     
+ Misses       1014     1013       -1     
- Partials      645      647       +2     
Impacted Files Coverage Δ
pkg/anchor/witness/policy/config/parser.go 95.23% <100.00%> (+0.11%) ⬆️
pkg/httpserver/server.go 79.03% <0.00%> (-3.12%) ⬇️
pkg/webfinger/client/client.go 85.71% <0.00%> (-2.41%) ⬇️
cmd/orb-driver/startcmd/start.go 43.18% <0.00%> (-0.50%) ⬇️
pkg/pubsub/amqp/amqppubsub.go 89.37% <0.00%> (-0.33%) ⬇️
cmd/orb-server/startcmd/params.go 81.26% <0.00%> (-0.04%) ⬇️
cmd/orb-cli/witnesscmd/witness.go 94.64% <0.00%> (+0.04%) ⬆️
cmd/orb-cli/followcmd/follow.go 94.54% <0.00%> (+0.05%) ⬆️
...d/orb-cli/ipnshostmetagencmd/ipnshostmetagencmd.go 90.80% <0.00%> (+0.10%) ⬆️
cmd/orb-cli/common/common.go 79.67% <0.00%> (+0.11%) ⬆️
... and 5 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 dd5b0bf...b147b0e. Read the comment docs.

@sandrask sandrask merged commit 52312de into trustbloc:main Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce 0 or positive integer for minimum number of witnesses in witness policy
3 participants