Skip to content

Commit 64f4f1b

Browse files
mmsqeHuangYi
andcommitted
Problem: unable to query historical txs whose module is removed (crypto-org-chain#1713)
* Problem: unable to query historical txs from deleted icaauth module * test * poetry * deps * add unit tets * cleanup * rename * revert integration test * revert * add authz * changelog * test authz * cleanup * register in query * only patch encoding for tx service * Revert "only patch encoding for tx service" This reverts commit 4b1c141. --------- Co-authored-by: HuangYi <huang@crypto.com>
1 parent 28eb35e commit 64f4f1b

6 files changed

Lines changed: 1282 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Bug Fixes
66

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

910
### Improvements
1011

app/legacy.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package app
2+
3+
import (
4+
"github.com/cosmos/cosmos-sdk/codec"
5+
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
6+
"github.com/cosmos/cosmos-sdk/x/authz"
7+
icaauthtypes "github.com/crypto-org-chain/cronos/v2/app/legacy/icaauth/types"
8+
)
9+
10+
func RegisterLegacyCodec(cdc *codec.LegacyAmino) {
11+
icaauthtypes.RegisterCodec(cdc)
12+
authz.RegisterLegacyAminoCodec(cdc)
13+
}
14+
15+
func RegisterLegacyInterfaces(registry cdctypes.InterfaceRegistry) {
16+
icaauthtypes.RegisterInterfaces(registry)
17+
authz.RegisterInterfaces(registry)
18+
}

app/legacy/icaauth/types/codec.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package types
2+
3+
import (
4+
"github.com/cosmos/cosmos-sdk/codec"
5+
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
6+
sdk "github.com/cosmos/cosmos-sdk/types"
7+
"github.com/cosmos/cosmos-sdk/types/msgservice"
8+
)
9+
10+
func RegisterCodec(cdc *codec.LegacyAmino) {
11+
cdc.RegisterConcrete(&MsgRegisterAccount{}, "icaauth/RegisterAccount", nil)
12+
cdc.RegisterConcrete(&MsgSubmitTx{}, "icaauth/SubmitTx", nil)
13+
}
14+
15+
func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
16+
registry.RegisterImplementations((*sdk.Msg)(nil),
17+
&MsgRegisterAccount{},
18+
)
19+
registry.RegisterImplementations((*sdk.Msg)(nil),
20+
&MsgSubmitTx{},
21+
)
22+
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
23+
}

0 commit comments

Comments
 (0)