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 cli for tips transactions #10311

Merged
merged 230 commits into from
Dec 7, 2021
Merged

feat: add cli for tips transactions #10311

merged 230 commits into from
Dec 7, 2021

Conversation

atheeshp
Copy link
Contributor

@atheeshp atheeshp commented Oct 6, 2021

Description

Closes: #10264

This PR makes 2 changes in the CLI:

1. Add an --aux flag to all tx command.

simd tx bank send <from> <to> <amount> --aux (optional: --tip <tipAmt> --tipper <tipper>)

This will print an AuxSignerData instead of broadcasting the tx.

2. Add a new aux-to-fee subcommand

simd tx aux-to-fee <aux_signer_data.json>

This takes the output of the previous command, and broadcasts a 2-signer tx.


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)

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

it's looking pretty good! A couple of last nits

client/flags/flags.go Outdated Show resolved Hide resolved
client/flags/flags.go Outdated Show resolved Hide resolved
client/tx/factory.go Show resolved Hide resolved
client/tx/tx.go Outdated Show resolved Hide resolved
client/tx/tx.go Outdated Show resolved Hide resolved
client/tx/tx_test.go Outdated Show resolved Hide resolved
x/auth/client/testutil/suite.go Outdated Show resolved Hide resolved
client/tx/tx.go Outdated Show resolved Hide resolved
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

Nice! Last couple of nits.

@atheeshp could you also add a changelog entry?

client/tx/tx_test.go Outdated Show resolved Hide resolved
client/tx/tx.go Outdated Show resolved Hide resolved
client/tx/tx.go Show resolved Hide resolved
client/tx/tx.go Outdated Show resolved Hide resolved
x/auth/client/cli/tips.go Outdated Show resolved Hide resolved
x/auth/client/testutil/suite.go Outdated Show resolved Hide resolved
x/auth/client/testutil/suite.go Show resolved Hide resolved
x/auth/client/testutil/suite.go Outdated Show resolved Hide resolved
x/auth/client/testutil/suite.go Outdated Show resolved Hide resolved
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

Approving, thanks a lot Atheesh!

Pending changelog entry

Comment on lines +143 to +146
parsedTips, err := sdk.ParseCoinsNormalized(tip)
if err != nil {
panic(err)
}
Copy link
Contributor

@amaury1093 amaury1093 Dec 7, 2021

Choose a reason for hiding this comment

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

@atheeshp if you can find a way to:

  • move this logic together with the "check tipper not empty" logic
  • not panic in the CLI

then that would be ideal! If not, then it's okay like this too.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Copy link
Contributor

@i-norden i-norden left a comment

Choose a reason for hiding this comment

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

Weird, I can see in my github history that I reviewed this. But the only comment of mine I see is the one responding to Amaury... In any case, I can't find any remaining issues!

@amaury1093
Copy link
Contributor

thanks for the review @i-norden ! No you didn't dream, I also remember your previous review comments #10311 (comment)

@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Dec 7, 2021
@mergify mergify bot merged commit 5f840be into master Dec 7, 2021
@mergify mergify bot deleted the atheesh/tips-cli branch December 7, 2021 18:02
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

Closes: cosmos#10264 

This PR makes 2 changes in the CLI:

### 1. Add an `--aux` flag to all tx command.

```bash
simd tx bank send <from> <to> <amount> --aux (optional: --tip <tipAmt> --tipper <tipper>)
```

This will print an AuxSignerData instead of broadcasting the tx.

### 2. Add a new `aux-to-fee` subcommand

```bash
simd tx aux-to-fee <aux_signer_data.json>
```

This takes the output of the previous command, and broadcasts a 2-signer tx.



<!-- 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)
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
<!--
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

Closes: cosmos#10264 

This PR makes 2 changes in the CLI:

### 1. Add an `--aux` flag to all tx command.

```bash
simd tx bank send <from> <to> <amount> --aux (optional: --tip <tipAmt> --tipper <tipper>)
```

This will print an AuxSignerData instead of broadcasting the tx.

### 2. Add a new `aux-to-fee` subcommand

```bash
simd tx aux-to-fee <aux_signer_data.json>
```

This takes the output of the previous command, and broadcasts a 2-signer tx.



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

CLI for Tips transactions
4 participants