Skip to content

Commit

Permalink
chore!: remove deprecated code (#17985)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Oct 6, 2023
1 parent 4df8b37 commit 68a21f6
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 104 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* `RegisterLegacyAmino` was removed from `AppModuleBasic`
* (x/staking) [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `QueryHistoricalInfo` was adjusted to return `HistoricalRecord` and marked `Hist` as deprecated.
* (types) [#17885](https://github.com/cosmos/cosmos-sdk/pull/17885) `InitGenesis` & `ExportGenesis` now take `context.Context` instead of `sdk.Context`
* (x/auth) [#17985](https://github.com/cosmos/cosmos-sdk/pull/17985) Remove `StdTxConfig`
* Remove depreacted `MakeTestingEncodingParams` from `simapp/params`

### CLI Breaking Changes

Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ TEST_TARGETS := test-unit test-unit-amino test-unit-proto test-ledger-mock test-
# a new rule, customise ARGS or TEST_PACKAGES ad libitum, and
# append the new rule to the TEST_TARGETS list.
test-unit: test_tags += cgo ledger test_ledger_mock norace
test-unit-amino: test_tags += ledger test_ledger_mock test_amino norace
test-ledger: test_tags += cgo ledger norace
test-ledger-mock: test_tags += ledger test_ledger_mock norace
test-race: test_tags += cgo ledger test_ledger_mock
Expand All @@ -215,7 +214,6 @@ $(TEST_TARGETS): run-tests
# note: go test -c doesn't support multiple packages yet (https://github.com/golang/go/issues/15513)
CHECK_TEST_TARGETS := check-test-unit check-test-unit-amino
check-test-unit: test_tags += cgo ledger test_ledger_mock norace
check-test-unit-amino: test_tags += ledger test_ledger_mock test_amino norace
$(CHECK_TEST_TARGETS): EXTRA_ARGS=-run=none
$(CHECK_TEST_TARGETS): run-tests

Expand Down
27 changes: 0 additions & 27 deletions simapp/params/amino.go

This file was deleted.

27 changes: 0 additions & 27 deletions simapp/params/proto.go

This file was deleted.

48 changes: 0 additions & 48 deletions x/auth/migrations/legacytx/stdtx_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,54 +66,6 @@ func (s *StdTxBuilder) AddAuxSignerData(_ tx.AuxSignerData) error {
return sdkerrors.ErrLogic.Wrap("cannot use AuxSignerData with StdTxBuilder")
}

// StdTxConfig is a context.TxConfig for StdTx
type StdTxConfig struct {
Cdc *codec.LegacyAmino
}

// MarshalTx implements TxConfig.MarshalTx
func (s StdTxConfig) TxEncoder() sdk.TxEncoder {
return DefaultTxEncoder(s.Cdc)
}

func (s StdTxConfig) TxJSONEncoder() sdk.TxEncoder {
return func(tx sdk.Tx) ([]byte, error) {
return s.Cdc.MarshalJSON(tx)
}
}

func (s StdTxConfig) MarshalSignatureJSON(sigs []signing.SignatureV2) ([]byte, error) {
stdSigs := make([]StdSignature, len(sigs))
for i, sig := range sigs {
stdSig, err := SignatureV2ToStdSignature(s.Cdc, sig)
if err != nil {
return nil, err
}

stdSigs[i] = stdSig
}
return s.Cdc.MarshalJSON(stdSigs)
}

func (s StdTxConfig) UnmarshalSignatureJSON(bz []byte) ([]signing.SignatureV2, error) {
var stdSigs []StdSignature
err := s.Cdc.UnmarshalJSON(bz, &stdSigs)
if err != nil {
return nil, err
}

sigs := make([]signing.SignatureV2, len(stdSigs))
for i, stdSig := range stdSigs {
sig, err := StdSignatureToSignatureV2(s.Cdc, stdSig)
if err != nil {
return nil, err
}
sigs[i] = sig
}

return sigs, nil
}

// SignatureV2ToStdSignature converts a SignatureV2 to a StdSignature
// [Deprecated]
func SignatureV2ToStdSignature(cdc *codec.LegacyAmino, sig signing.SignatureV2) (StdSignature, error) {
Expand Down

0 comments on commit 68a21f6

Please sign in to comment.