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

feat: Add Tips middleware #10208

Merged
merged 54 commits into from
Nov 16, 2021
Merged

feat: Add Tips middleware #10208

merged 54 commits into from
Nov 16, 2021

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Sep 21, 2021

Description

R4R

Closes: #9912

This PR introduces 1 new middleware:

  • TipsMiddleware: transfer tip from tipper to feePayer when relevant.

It also makes sure in the DIRECT_AUX sign mode handler that the fee payer cannot use that sign mode.

Depends on:


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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers 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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@orijbot
Copy link

orijbot commented Sep 21, 2021

@amaury1093 amaury1093 changed the base branch from master to atheesh/ah-to-mw September 30, 2021 13:27
@amaury1093 amaury1093 force-pushed the am/9912-tips-middleware branch 2 times, most recently from e88a279 to aaa956d Compare September 30, 2021 13:30
@github-actions github-actions bot added the C:CLI label Sep 30, 2021
Base automatically changed from atheesh/ah-to-mw to master October 1, 2021 14:30
x/auth/tx/mode_handler.go Outdated Show resolved Hide resolved
@amaury1093 amaury1093 marked this pull request as ready for review October 1, 2021 14:49
types/tx/tips.go Outdated Show resolved Hide resolved
types/tx/tips.go Outdated Show resolved Hide resolved
@amaury1093
Copy link
Contributor Author

Putting as draft for now, until we make a decision about tipper signing on ledger.

@amaury1093 amaury1093 marked this pull request as draft October 11, 2021 09:53
x/auth/tx/direct_aux.go Outdated Show resolved Hide resolved
@amaury1093
Copy link
Contributor Author

Pausing this (again) because of #10208 (comment)

@tac0turtle
Copy link
Member

@AmauryM is it okay to close this for now? We can reopen when a decision has been made or its ready to continue,

@amaury1093
Copy link
Contributor Author

@AmauryM is it okay to close this for now? We can reopen when a decision has been made or its ready to continue,

This just got unblocked by #10455. I'll restart working on this today.

@amaury1093
Copy link
Contributor Author

R4R again!

@amaury1093 amaury1093 marked this pull request as ready for review November 16, 2021 11:01
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

utACK.

would be nice to add some docs on how to use this, maybe an issue, or if you have some extra cycles

@amaury1093
Copy link
Contributor Author

@marbar3778 Yeah agreed. I created #10426 some time ago, I think ideal docs should be a story around AuxTxBuilder, SIGN_MODE_DIRECT_AUX and transactions all bundled together.

@amaury1093
Copy link
Contributor Author

This has 2 approvals, but let's have someone from the TX working group also have a look - we'll assign someone during our sync today.

x/auth/middleware/tips.go Outdated Show resolved Hide resolved
@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Nov 16, 2021
@mergify mergify bot merged commit a72f6a8 into master Nov 16, 2021
@mergify mergify bot deleted the am/9912-tips-middleware branch November 16, 2021 17:55
blewater pushed a commit to e-money/cosmos-sdk that referenced this pull request Dec 8, 2021
<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

R4R

Closes: cosmos#9912 

This PR introduces 1 new middleware:
- `TipsMiddleware`: transfer tip from tipper to feePayer when relevant.

It also makes sure in the DIRECT_AUX sign mode handler that the fee payer cannot use that sign mode.

Depends on:
- [x]  cosmos#10028 
- [x] cosmos#10268 
- [x] cosmos#10322 
- [x] cosmos#10346 

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### 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...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers 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...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
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:CLI C:x/auth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Tx Middleware for Tips
6 participants