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

Add Fee granter field #7418

Merged
merged 9 commits into from
Oct 5, 2020
Merged

Add Fee granter field #7418

merged 9 commits into from
Oct 5, 2020

Conversation

aaronc
Copy link
Member

@aaronc aaronc commented Sep 30, 2020

Following up on https://github.com/cosmos/cosmos-sdk/pull/7384/files#r495258961, this adds the a granter field to cosmos.tx.v1beta1.Fee in preparation for fee grants (#7106, #5768, #7074).

For now, it just rejects transactions with granter set and serves as a placeholder for this functionality in the future.

Adding the granter field now has the benefit of preventing spurious unknown field rejections for future protobuf clients which unnecessarily encode default values, as well as clearer error messages.


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

@codecov
Copy link

codecov bot commented Sep 30, 2020

Codecov Report

Merging #7418 into master will increase coverage by 0.01%.
The diff coverage is 77.77%.

@@            Coverage Diff             @@
##           master    #7418      +/-   ##
==========================================
+ Coverage   55.23%   55.24%   +0.01%     
==========================================
  Files         590      591       +1     
  Lines       36914    36932      +18     
==========================================
+ Hits        20390    20404      +14     
- Misses      14420    14422       +2     
- Partials     2104     2106       +2     

Copy link
Contributor

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Nice one. I would just remove the ante decorator to simplify it

x/auth/ante/ante.go Show resolved Hide resolved
proto/cosmos/tx/v1beta1/tx.proto Show resolved Hide resolved
proto/cosmos/tx/v1beta1/tx.proto Show resolved Hide resolved
@aaronc aaronc marked this pull request as ready for review October 5, 2020 17:27
Comment on lines +71 to +72
feeGranter := tx.FeeGranter()
require.Empty(t, feeGranter)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
feeGranter := tx.FeeGranter()
require.Empty(t, feeGranter)
require.Empty(t, tx.FeeGranter())

Copy link
Contributor

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Good stuff

// RejectFeeGranterDecorator is a placeholder AnteDecorator for fee grants for
// when that functionality is enabled. Currently it simpy rejects transactions
// which have the Fee.granter field set.
// RejectFeeGranterDecorator is an AnteDecorator which rejects transactions which
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@aaronc aaronc added the A:automerge Automatically merge PR once all prerequisites pass. label Oct 5, 2020
@mergify mergify bot merged commit 4a1b2fb into master Oct 5, 2020
@mergify mergify bot deleted the aaronc/fee-granter-field branch October 5, 2020 21:56
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. C:x/auth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants