-
Notifications
You must be signed in to change notification settings - Fork 402
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
Introduce new AccessType to allow a set of addresses #974
Conversation
Codecov Report
@@ Coverage Diff @@
## main #974 +/- ##
==========================================
+ Coverage 59.29% 60.48% +1.18%
==========================================
Files 51 51
Lines 6238 6311 +73
==========================================
+ Hits 3699 3817 +118
+ Misses 2272 2224 -48
- Partials 267 270 +3
|
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.
Looks good.
Added some minor style comments.
Seems one whole-system test is missing (that actually executes keeper logic with AnyOf), but otherwise good to merge from my side.
@@ -19,12 +19,16 @@ enum AccessType { | |||
// AccessTypeNobody forbidden | |||
ACCESS_TYPE_NOBODY = 1 | |||
[ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ]; | |||
// AccessTypeOnlyAddress restricted to an address | |||
// AccessTypeOnlyAddress restricted to a single address | |||
// Deprecated: use AccessTypeAnyOfAddresses instead |
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.
Why deprecate?
I think it is fine to use the simpler version for the cases where it works
8004bde
to
089076d
Compare
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.
Looks good to me
Short: "Submit an update instantiate config proposal.", | ||
Args: cobra.MinimumNArgs(1), | ||
Long: strings.TrimSpace( | ||
fmt.Sprintf(`Submit an update instantiate config proposal for multiple code ids. | ||
|
||
Example: | ||
$ %s tx gov submit-proposal update-instantiate-config 1,nobody 2,everybody 3,%s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm | ||
`, version.AppName, bech32Prefix)), | ||
$ %s tx gov submit-proposal update-instantiate-config 1:nobody 2:everybody 3:%s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm,%s1vx8knpllrj7n963p9ttd80w47kpacrhuts497x |
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.
Nice! I think this should work fine.
}, | ||
} | ||
for name, spec := range specs { | ||
t.Run(name, func(t *testing.T) { |
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.
Nice set of tests!
Thanks for the feedback! |
Resolves #945
Introduces a new Access type to allow a set of addresses to accept.
This PR includes a small but breaking change to the CLI. The separator char between codeID and permission is
:
now:Before:
Now:
wasmd tx gov submit-proposal update-instantiate-config 1:nobody 2:everybody 3:wasm1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm,wasm1vx8knpllrj7n963p9ttd80w47kpacrhuts497x`
AccessConfig.Address
intoAccessConfig.Addresses
see proto? - keep and remove in a future version