Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Bug Fixes

* [#1714](https://github.com/crypto-org-chain/cronos/pull/1714) Avoid nil pointer error when query blocks before feemarket module gets enabled.
* [#1713](https://github.com/crypto-org-chain/cronos/pull/1713) Register legacy codec to allow query historical txs whose modules are removed (icaauth, authz).

### Improvements

Expand Down
18 changes: 18 additions & 0 deletions app/legacy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package app

import (
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/x/authz"
icaauthtypes "github.com/crypto-org-chain/cronos/v2/app/legacy/icaauth/types"
)

func RegisterLegacyCodec(cdc *codec.LegacyAmino) {
icaauthtypes.RegisterCodec(cdc)
authz.RegisterLegacyAminoCodec(cdc)
}

func RegisterLegacyInterfaces(registry cdctypes.InterfaceRegistry) {
icaauthtypes.RegisterInterfaces(registry)
authz.RegisterInterfaces(registry)
}
23 changes: 23 additions & 0 deletions app/legacy/icaauth/types/codec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package types

import (
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
)

func RegisterCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgRegisterAccount{}, "icaauth/RegisterAccount", nil)
cdc.RegisterConcrete(&MsgSubmitTx{}, "icaauth/SubmitTx", nil)
}

func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgRegisterAccount{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgSubmitTx{},
)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
Loading
Loading