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

x/feegrant completeness audit updates #9177

Merged
merged 13 commits into from
Apr 27, 2021
Merged

Conversation

blushi
Copy link
Contributor

@blushi blushi commented Apr 22, 2021

Description

ref: #9115
Address x/feegrant completeness audit updates:

  • remove dead code in https://github.com/cosmos/cosmos-sdk/blob/master/x/feegrant/genesis.go#L9-L21 (we're declaring some GenesisState struct while there's already the proto-generated GenesisState type in x/feegrant/types).
  • improve test coverage in InitGenesis in case of error
  • QueryServer in x/feegrant/keeper/grpc_query.go is not covered by tests in x/feegrant/keeper/keeper_test.go but indirectly in x/feegrant/client/rest/grpc_query_test.go using grpc-gateway REST endpoints. This x/feegrant/client/rest folder must be some leftovers of legacy REST routes from the initial feegrant module implementation but it doesn't make sense to keep it since the module doesn't support legacy REST routes. Those tests should be moved to x/feegrant/keeper/keeper_test.go.
  • For the tx commands, in the cobra command Use field, we use granter and grantee as arguments names in one command and in the other one, we use granter_address and grantee_address. It would be good to have consistent naming across all feegrant commands.
  • in tx CLI, we are using seconds for time-based expiration from the user, it should be timestamp

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@blushi blushi mentioned this pull request Apr 22, 2021
7 tasks
@codecov
Copy link

codecov bot commented Apr 23, 2021

Codecov Report

Merging #9177 (d50c361) into master (fc256a3) will increase coverage by 0.13%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9177      +/-   ##
==========================================
+ Coverage   59.72%   59.86%   +0.13%     
==========================================
  Files         595      595              
  Lines       37346    37355       +9     
==========================================
+ Hits        22306    22361      +55     
+ Misses      13059    13011      -48     
- Partials     1981     1983       +2     
Impacted Files Coverage Δ
x/feegrant/module.go 45.65% <33.33%> (-2.08%) ⬇️
x/feegrant/genesis.go 90.90% <80.00%> (+44.48%) ⬆️
x/feegrant/client/testutil/suite.go 99.15% <100.00%> (+0.01%) ⬆️
x/feegrant/keeper/grpc_query.go 81.39% <0.00%> (+81.39%) ⬆️

Copy link
Collaborator

@anilcse anilcse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just small nits

x/feegrant/client/cli/tx.go Outdated Show resolved Hide resolved
x/feegrant/client/cli/tx.go Show resolved Hide resolved
x/feegrant/genesis.go Show resolved Hide resolved
Copy link
Contributor

@atheeshp atheeshp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

x/feegrant/client/cli/cli_test.go Outdated Show resolved Hide resolved
@blushi blushi added the A:automerge Automatically merge PR once all prerequisites pass. label Apr 27, 2021
@mergify mergify bot merged commit 3ab1bc2 into master Apr 27, 2021
@mergify mergify bot deleted the marie/9115-feegrant-updates branch April 27, 2021 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants