Remove the sdk.{TxWithMemo, FeeTx, TxWithTimeoutHeight...} interfaces and use the *tx.Tx proto-generated Tx struct instead
Replace the tx middleware interface to use tx.Tx
// TxHandler defines the baseapp's CheckTx, DeliverTx and Simulate respective
// handlers. It is designed as a middleware stack.
type Handler interface {
Problem
We used to introduce these interfaces to support both proto Txs (
*tx.Tx
) and amino (StdTx
...)In the middlewares, we are currently hardcoding the
sdk.Tx
interface, which introduces a lot of type casting in the implementation.Ideas
Deprecate:
https://github.com/cosmos/cosmos-sdk/blob/994219a4d2f467a0bd628d60d8670c1102edbe88/types/tx_msg.go#L38-L69
and slowly remove its usage from code.
sdk.{TxWithMemo, FeeTx, TxWithTimeoutHeight...}
interfaces and use the*tx.Tx
proto-generated Tx struct insteadtx.Tx
Proposal
Step 1: Change the middleware interface to use concrete Tx.
We need to do the following changes:
Make the
wrapper
public. Probably find a better name, but we can useWrapper
for now.Change the tx.Handler interface
Make sure there's no dep cycles.
Notes
The last place where amino StdTx were used by default was in legacy API, which was removed in #9594 .