refactor(authz):remove global bech32 (#15662)

This commit is contained in:
Marko
2023-04-03 13:55:32 +02:00
committed by GitHub
parent b4d1109efc
commit 521aa4bfdd
20 changed files with 141 additions and 64 deletions
+7 -5
View File
@@ -10,6 +10,7 @@ import (
"github.com/spf13/cobra"
modulev1 "cosmossdk.io/api/cosmos/authz/module/v1"
"cosmossdk.io/core/address"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/depinject"
@@ -38,6 +39,7 @@ var (
// AppModuleBasic defines the basic application module used by the authz module.
type AppModuleBasic struct {
cdc codec.Codec
ac address.Codec
}
// Name returns the authz module's name.
@@ -91,13 +93,13 @@ func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, m
}
// GetQueryCmd returns the cli query commands for the authz module
func (AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd()
func (ab AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd(ab.ac)
}
// GetTxCmd returns the transaction commands for the authz module
func (AppModuleBasic) GetTxCmd() *cobra.Command {
return cli.GetTxCmd()
func (ab AppModuleBasic) GetTxCmd() *cobra.Command {
return cli.GetTxCmd(ab.ac)
}
// AppModule implements the sdk.AppModule interface
@@ -112,7 +114,7 @@ type AppModule struct {
// NewAppModule creates a new AppModule object
func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak authz.AccountKeeper, bk authz.BankKeeper, registry cdctypes.InterfaceRegistry) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{cdc: cdc},
AppModuleBasic: AppModuleBasic{cdc: cdc, ac: ak},
keeper: keeper,
accountKeeper: ak,
bankKeeper: bk,