cosmos-sdk/x/auth
atheeshp 5d86db3ce5
refactor: middleware refactor to change tx.Handler interface (#10527)
<!--
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: #10484 

This PR makes the following big changes:

### 1. Change the tx.Handler interface

```diff
-	CheckTx(ctx context.Context, tx sdk.Tx, req abci.RequestCheckTx) (abci.ResponseCheckTx, error)
+	CheckTx(ctx context.Context, req tx.Request, checkReq tx.RequestCheckTx) (tx.Response, tx.ResponseCheckTx, error)
// same for Deliver and Simulate
```
 where:

```go
type Response struct {
	GasWanted uint64
	GasUsed   uint64
	// MsgResponses is an array containing each Msg service handler's response
	// type, packed in an Any. This will get proto-serialized into the `Data` field
	// in the ABCI Check/DeliverTx responses.
	MsgResponses []*codectypes.Any
	Log          string
	Events       []abci.Event
}
```

### 2. Change what gets passed into the ABCI Check/DeliverTx `Data` field

Before, we were passing the concatenation of MsgResponse bytes into the `Data`. Now we are passing the proto-serialiazation of this struct:

```proto
message TxMsgData {
  repeated google.protobuf.Any msg_responses = 2;
}
```

<!-- 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)
2021-12-02 06:54:38 +00:00
..
atlas chore: add markdownlint to lint commands (#9353) 2021-05-27 15:31:04 +00:00
client chore: bump TM to v0.35.0 release candidate (#10210) 2021-11-16 11:24:38 -08:00
keeper feat!: Ensure InitGenesis returns with non-empty validator set (#9697) 2021-10-05 12:02:51 +00:00
middleware refactor: middleware refactor to change tx.Handler interface (#10527) 2021-12-02 06:54:38 +00:00
migrations feat: Add Tips middleware (#10208) 2021-11-16 17:55:12 +00:00
signing feat: Add Tips middleware (#10208) 2021-11-16 17:55:12 +00:00
simulation refactor(test)!: refactor simapp.Setup function (#9938) 2021-08-17 00:52:06 +00:00
spec style: lint go and markdown (#10060) 2021-10-30 13:43:04 +00:00
testutil feat: Add Tips middleware (#10208) 2021-11-16 17:55:12 +00:00
tx refactor: middleware refactor to change tx.Handler interface (#10527) 2021-12-02 06:54:38 +00:00
types feat: Add Tips middleware (#10208) 2021-11-16 17:55:12 +00:00
vesting chore: bump TM to v0.35.0 release candidate (#10210) 2021-11-16 11:24:38 -08:00
genesis.go Enable proto JSON for genesis (#7000) 2020-08-11 14:22:30 +00:00
module_test.go feat!: Ensure InitGenesis returns with non-empty validator set (#9697) 2021-10-05 12:02:51 +00:00
module.go feat!: remove legacy handler (#9650) 2021-07-19 14:49:42 +00:00