Skip to content

Commit

Permalink
Merge pull request #311 from rootulp/rp/override-tx-decoder
Browse files Browse the repository at this point in the history
feat: expose SetTxDecoder
  • Loading branch information
rootulp authored Apr 27, 2023
2 parents 50f4c49 + c6e53b2 commit c4aea6f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/tx_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type (
TxEncodingConfig interface {
TxEncoder() sdk.TxEncoder
TxDecoder() sdk.TxDecoder
SetTxDecoder(sdk.TxDecoder)
TxJSONEncoder() sdk.TxEncoder
TxJSONDecoder() sdk.TxDecoder
MarshalSignatureJSON([]signingtypes.SignatureV2) ([]byte, error)
Expand Down
4 changes: 4 additions & 0 deletions x/auth/migrations/legacytx/stdtx_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ func (s StdTxConfig) TxDecoder() sdk.TxDecoder {
return mkDecoder(s.Cdc.Unmarshal)
}

func (s StdTxConfig) SetTxDecoder(t sdk.TxDecoder) {
// no-op
}

func (s StdTxConfig) TxJSONEncoder() sdk.TxEncoder {
return func(tx sdk.Tx) ([]byte, error) {
return s.Cdc.MarshalJSON(tx)
Expand Down
4 changes: 4 additions & 0 deletions x/auth/tx/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ func (g config) TxDecoder() sdk.TxDecoder {
return g.decoder
}

func (g *config) SetTxDecoder(decoder sdk.TxDecoder) {
g.decoder = decoder
}

func (g config) TxJSONEncoder() sdk.TxEncoder {
return g.jsonEncoder
}
Expand Down

0 comments on commit c4aea6f

Please sign in to comment.