@@ -4,21 +4,17 @@ import (
44 "os"
55
66 "cosmossdk.io/client/v2/autocli"
7- "cosmossdk.io/core/address"
87 "cosmossdk.io/depinject"
98 "cosmossdk.io/log"
10- "cosmossdk.io/x/tx/signing"
119 "github.com/cosmos/cosmos-sdk/client"
1210 "github.com/cosmos/cosmos-sdk/client/config"
1311 "github.com/cosmos/cosmos-sdk/codec"
1412 codectypes "github.com/cosmos/cosmos-sdk/codec/types"
15- "github.com/cosmos/cosmos-sdk/runtime"
1613 "github.com/cosmos/cosmos-sdk/server"
1714 "github.com/cosmos/cosmos-sdk/types/module"
1815 "github.com/cosmos/cosmos-sdk/x/auth/tx"
1916 authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
2017 "github.com/cosmos/cosmos-sdk/x/auth/types"
21- "github.com/cosmos/gogoproto/proto"
2218 "github.com/spf13/cobra"
2319
2420 "<%= ModulePath %>/app"
@@ -36,7 +32,6 @@ func NewRootCmd() *cobra.Command {
3632 depinject.Configs(app.AppConfig(),
3733 depinject.Supply(log.NewNopLogger()),
3834 depinject.Provide(
39- ProvideInterfaceRegistry,
4035 ProvideClientContext,
4136 ),
4237 ),
@@ -101,7 +96,7 @@ func NewRootCmd() *cobra.Command {
10196// allowing it to be used for dependency injection and CLI operations.
10297func ProvideClientContext(
10398 appCodec codec.Codec,
104- interfaceRegistry InterfaceRegistry,
99+ interfaceRegistry codectypes. InterfaceRegistry,
105100 txConfigOpts tx.ConfigOptions,
106101 legacyAmino *codec.LegacyAmino,
107102) client.Context {
@@ -127,42 +122,3 @@ func ProvideClientContext(
127122
128123 return clientCtx
129124}
130-
131- // InterfaceRegistry represents the codectypes.InterfaceRegistry wrapper.
132- type InterfaceRegistry codectypes.InterfaceRegistry
133-
134- // ProvideInterfaceRegistry resolves an issue with the proto.HybridResolver not
135- // properly fetching the chain module messages into the interface registry.
136- // This implementation ensures the proto.MergedRegistry() is called to correctly
137- // initialize all proto message descriptors. Without this, the chain CLI query commands
138- // return empty or incomplete data.
139- // TODO consider removing this workaround once the SDK or Ignite resolves the issue.
140- func ProvideInterfaceRegistry(addressCodec address.Codec, validatorAddressCodec runtime.ValidatorAddressCodec, customGetSigners []signing.CustomGetSigner) (InterfaceRegistry, error) {
141- signingOptions := signing.Options{
142- AddressCodec: addressCodec,
143- ValidatorAddressCodec: validatorAddressCodec,
144- }
145-
146- for _, signer := range customGetSigners {
147- signingOptions.DefineCustomGetSigners(signer.MsgType, signer.Fn)
148- }
149-
150- mergedFiles, err := proto.MergedRegistry()
151- if err != nil {
152- return nil, err
153- }
154-
155- interfaceRegistry, err := codectypes.NewInterfaceRegistryWithOptions(codectypes.InterfaceRegistryOptions{
156- ProtoFiles: mergedFiles,
157- SigningOptions: signingOptions,
158- })
159- if err != nil {
160- return nil, err
161- }
162-
163- if err := interfaceRegistry.SigningContext().Validate(); err != nil {
164- return nil, err
165- }
166-
167- return interfaceRegistry, nil
168- }
0 commit comments