cosmos-sdk/docs/core
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
..
README.md documentation for in-place migrations with x/upgrade module (#8967) 2021-04-14 08:49:17 +00:00
baseapp.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
baseapp_state-begin_block.png Merge PR #4748: Write-Through Inter-Block Cache 2019-09-04 13:33:32 -04:00
baseapp_state-checktx.png Merge PR #4748: Write-Through Inter-Block Cache 2019-09-04 13:33:32 -04:00
baseapp_state-commit.png Merge PR #4748: Write-Through Inter-Block Cache 2019-09-04 13:33:32 -04:00
baseapp_state-deliver_tx.png Merge PR #4748: Write-Through Inter-Block Cache 2019-09-04 13:33:32 -04:00
baseapp_state-initchain.png Merge PR #4748: Write-Through Inter-Block Cache 2019-09-04 13:33:32 -04:00
baseapp_state_types.png Merge PR #4748: Write-Through Inter-Block Cache 2019-09-04 13:33:32 -04:00
cli.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
context.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
encoding.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
events.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
grpc_rest.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
node.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
ocap.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
proto-docs.md refactor: middleware refactor to change tx.Handler interface (#10527) 2021-12-02 06:54:38 +00:00
runtx_middleware.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
simulation.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
store.md feat: ADR-038 Part 2: StreamingService interface, file writing implementation, and configuration (#8664) 2021-10-24 21:37:37 +00:00
telemetry.md perf: Remove more telemetry ops, update docs (#10334) 2021-10-11 08:23:42 +00:00
transactions.md docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
upgrade.md chore(upgrade): cleaning (#10413) 2021-10-22 10:56:08 +00:00

README.md

Core Concepts

This repository contains reference documentation on the core concepts of the Cosmos SDK.

  1. BaseApp
  2. Transaction
  3. Context
  4. Node Client
  5. Store
  6. Encoding
  7. gRPC, REST and Tendermint Endpoints
  8. Command-Line Interface
  9. Events
  10. Telemetry
  11. Object-Capabilities
  12. RunTx recovery middleware
  13. Simulation
  14. Protobuf documentation
  15. In-Place Store Migrations

After reading about the core concepts, check the IBC documentation to learn more about the IBC core concepts and how to integrate IBC in your application.