Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix!: remove time.now check from authz #10447
fix!: remove time.now check from authz #10447
Changes from 12 commits
c0f3519
a880e95
f8c86ca
9825643
972a7b8
f2799e1
2dd1818
bed10a3
44acf3f
5b1a54f
db3eeb7
3bf3409
43bff33
5fa72f7
0dbe13d
a15df00
f4e2231
469644b
b81865a
123a420
505ff43
1fe683b
940e165
3b38eda
6166e7e
e0704a8
54c3bee
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 are we putting this in the constructor? Shouldn't we just do this within the
MsgServer
when creating a grant?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.
We are validating the grant, here authorization + expiration relation. The motivation to have it in
NewGrant
is to do it once and make sure it's always validated.Moving it outside of the
NewGrant
would make sense if it would be a private method... but then we will need another function because other packages are usingNewGrant
.So. what do you think ?
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.
On the other hand NewGrant is used only in one place (not counting tests)
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.
I would rather just do it the correct way and valid block time when we're actually in a block... but not going to block either
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.
OK, I reworked the validation... was thinking about creating
Grant.Validate(now)
method, but it also wasn't perfect.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.
this function name (in tests) was misleading. It essentially creates a new grant and executes that message (grant creation). It doesn't execute on existing grant.