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

refactor: Move TxDecoder into its own middleware #10612

Merged
merged 59 commits into from
Dec 6, 2021

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Nov 25, 2021

Description

Closes: #10610


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)

Base automatically changed from ap/mw-refactor to master December 2, 2021 06:54
@lgtm-com
Copy link

lgtm-com bot commented Dec 2, 2021

This pull request introduces 1 alert when merging d6b0884 into 5d86db3 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@amaury1093 amaury1093 marked this pull request as ready for review December 2, 2021 08:04
Copy link
Contributor

@atheeshp atheeshp left a comment

Choose a reason for hiding this comment

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

lgtm

types/tx/middleware.go Outdated Show resolved Hide resolved
Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
@@ -112,6 +112,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/gov) [\#10373](https://github.com/cosmos/cosmos-sdk/pull/10373) Removed gov `keeper.{MustMarshal, MustUnmarshal}`.
* [\#10348](https://github.com/cosmos/cosmos-sdk/pull/10348) StdSignBytes takes a new argument of type `*tx.Tip` for signing over tips using LEGACY_AMINO_JSON.
* [\#10208](https://github.com/cosmos/cosmos-sdk/pull/10208) The `x/auth/signing.Tx` interface now also includes a new `GetTip() *tx.Tip` method for verifying tipped transactions. The `x/auth/types` expected BankKeeper interface now expects the `SendCoins` method too.
* [\#10612](https://github.com/cosmos/cosmos-sdk/pull/10612) `baseapp.NewBaseApp` constructor function doesn't take the `sdk.TxDecoder` anymore. This logic has been moved into the TxDecoderMiddleware.
Copy link
Member

Choose a reason for hiding this comment

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

good to mention this is required to be added in middleware, so when people read this they know this is a change they must make

@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Dec 6, 2021
@amaury1093 amaury1093 merged commit b3e922d into master Dec 6, 2021
@amaury1093 amaury1093 deleted the am/10610-txdecoder-middleware branch December 6, 2021 09:26
blewater pushed a commit to e-money/cosmos-sdk that referenced this pull request Dec 8, 2021
* WIP: middleware refactor

* refactor `tx.Request`

* Add MsgResponses any in sdk.Result

* add helper functions in abci

* refactor tips

* review changes

* Fix mock tests

* Update baseapp/abci.go

* Update baseapp/abci.go

* Update types/tx/middleware.go

* Update types/tx/middleware.go

* tx.Response to abci conversion

* refactor makeABCIData

* Add comments

* Fix build

* fix build error

* fix tests

* fix test

* fix tests

* Fix TestSimulateTx

* fix tests

* fix test

* Fix build

* Simplify code

* fix test build

* Use repeated bytes in txMsgData

* Fix grpc-gateway test

* Make proto-gen

* Automagically register MsgResponse

* review changes

* Use froydi's trick

* Use Any in TxMsgData

* Finally remove API breaking change

* Revert unnecessary stuff

* refactor: Move TxDecoder into its own middleware

* Add test for txDecoderMiddleware

* Fix some baseapp tests

* Fix some more tests

* Fix mock tests

* Fix middleware tests

* Add cl

* Fix tests

* Update types/tx/middleware.go

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>

Co-authored-by: atheesh <atheesh@vitwit.com>
Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* WIP: middleware refactor

* refactor `tx.Request`

* Add MsgResponses any in sdk.Result

* add helper functions in abci

* refactor tips

* review changes

* Fix mock tests

* Update baseapp/abci.go

* Update baseapp/abci.go

* Update types/tx/middleware.go

* Update types/tx/middleware.go

* tx.Response to abci conversion

* refactor makeABCIData

* Add comments

* Fix build

* fix build error

* fix tests

* fix test

* fix tests

* Fix TestSimulateTx

* fix tests

* fix test

* Fix build

* Simplify code

* fix test build

* Use repeated bytes in txMsgData

* Fix grpc-gateway test

* Make proto-gen

* Automagically register MsgResponse

* review changes

* Use froydi's trick

* Use Any in TxMsgData

* Finally remove API breaking change

* Revert unnecessary stuff

* refactor: Move TxDecoder into its own middleware

* Add test for txDecoderMiddleware

* Fix some baseapp tests

* Fix some more tests

* Fix mock tests

* Fix middleware tests

* Add cl

* Fix tests

* Update types/tx/middleware.go

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>

Co-authored-by: atheesh <atheesh@vitwit.com>
Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
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 C:x/upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TxDecoder as Middleware
3 participants