-
Notifications
You must be signed in to change notification settings - Fork 439
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
Add instantiate permission to CodeInfoResponse #836
Add instantiate permission to CodeInfoResponse #836
Conversation
Codecov Report
@@ Coverage Diff @@
## main #836 +/- ##
==========================================
+ Coverage 59.63% 59.87% +0.23%
==========================================
Files 52 52
Lines 5948 5951 +3
==========================================
+ Hits 3547 3563 +16
+ Misses 2139 2120 -19
- Partials 262 268 +6
|
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.
👍 Very nice! thanks for the contribution.
I was surprised to see no tests were touched nor failing. It looks like none is actually covering the full response object. As this is part of the public API we should ensure the expected data is returned.
The legacy querier
is deprecated already but adding 2 tests for the grpc querier would be a great contribution and fit into the scope of this PR.
Please let me know if you have capacity otherwise I can merge the PR as it is.
yes I can add the tests actually I already had one in draft will complete them and push the update. |
40ce965
to
bf5f328
Compare
@alpe added query 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.
thanks for the tests. looks good, but I will let @alpe take the final look and merge
codeId uint64 | ||
accessConfig types.AccessConfig | ||
}{ | ||
"everybody": { |
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.
lgtm
} | ||
} | ||
|
||
func TestQueryCodeInfoList(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 to cover this as well
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.
Well done and thanks for the additional tests! 💪
I commented some nits as I hope you can add more with your contributions in the future.
) | ||
}) | ||
|
||
allCodesResponse = append(allCodesResponse, types.CodeInfoResponse{ |
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.
When I am strict, then there is a little smell as the test cases are not independent.
When you import with a "cached store" , the modified state would not be persisted
ctx, _ := parentCtx.CacheContext()
return codeInfo | ||
} | ||
|
||
codes := []struct { |
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 mostly use map based table tests. I have this macro for Goland:
specs := map[string]struct{
$START$
}{
"$SECOND$": {
$THIRD$
},
}
for name, spec := range specs {
t.Run(name, func(t *testing.T) {
$FORTH$
})
}
closes #829