feat!: make grant expiration optional#11060
Conversation
932bb6d to
ecc83c1
Compare
ecc83c1 to
5201088
Compare
Codecov Report
@@ Coverage Diff @@
## master #11060 +/- ##
==========================================
+ Coverage 65.86% 65.89% +0.03%
==========================================
Files 675 675
Lines 69773 69789 +16
==========================================
+ Hits 45955 45988 +33
+ Misses 21118 21100 -18
- Partials 2700 2701 +1
|
| cmd.Flags().StringSlice(FlagAllowedValidators, []string{}, "Allowed validators addresses separated by ,") | ||
| cmd.Flags().StringSlice(FlagDenyValidators, []string{}, "Deny validators addresses separated by ,") | ||
| cmd.Flags().Int64(FlagExpiration, time.Now().AddDate(1, 0, 0).Unix(), "The Unix timestamp. Default is one year.") | ||
| cmd.Flags().Int64(FlagExpiration, 0, "Expire time as Unix timestamp. Set zero (0) for no expiry. Default is 0.") |
There was a problem hiding this comment.
I've changed the default here to zero = no expiration time.
Maybe we would like to explicitly require the value? In that case:
- 0 would be not allowed
- -1 = no expire date
There was a problem hiding this comment.
I think 0 == no expiration time makes the most sense.
Alternatively we can do:
- 0 == no expiry
- default is -1
- all negative values are not allowed
There was a problem hiding this comment.
Alternatively we can do: 0 == no expiry; default is -1
If we want to make the CLI param required, the I prefer -1 as no expire, this is because 0 would mean "default", and we don't want default (from the user perspective).
all negative values are not allowed
Now, all values < blocktime().unix() are not allowed , except zero.
There was a problem hiding this comment.
i was thinking:
| cmd.Flags().Int64(FlagExpiration, 0, "Expire time as Unix timestamp. Set zero (0) for no expiry. Default is 0.") | |
| cmd.Flags().Int64(FlagExpiration, -1, "Expire time as Unix timestamp. Set zero (0) for no expiry.") |
But tbh -1 = no expire date sounds good to me too, if there's a help message.
79649a3 to
2c4025b
Compare
x/authz/simulation/operations.go
Outdated
There was a problem hiding this comment.
bummer! calling a rand here will cause sim tests to fail :( This is because our simulation tests don't simulate much - they are almost 'pre defined': we have one grant message, one exec and one revoke. it's basically one premade scenario with lot of boilerplate.
f8284d0 to
cf7ab0d
Compare
blushi
left a comment
There was a problem hiding this comment.
Implementation looks good to me, pending simulations
amaury1093
left a comment
There was a problem hiding this comment.
Approving pending sims test fix, I suppose related to #11060 (comment)
atheeshp
left a comment
There was a problem hiding this comment.
lgtm, except sims & few nits.
|
Wow, there is a weird convolution, no idea why this test is failing: |
|
It is also failing in master |
|
@robert-zaremba It's fixed on master now |
Description
Closes: #11095
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!in the type prefix if API or client breaking change