Skip to content

Commit

Permalink
Completing authz module integration and added vesting cli
Browse files Browse the repository at this point in the history
  • Loading branch information
shahankhatch committed May 11, 2021
1 parent 9704d47 commit 399a209
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
19 changes: 18 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ import (
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
"github.com/cosmos/cosmos-sdk/x/authz"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
authztypes "github.com/cosmos/cosmos-sdk/x/authz/types"
"github.com/cosmos/cosmos-sdk/x/bank"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand Down Expand Up @@ -134,6 +137,8 @@ var (
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
feegranttypes.ModuleName: {authtypes.Minter, authtypes.Burner},
authztypes.ModuleName: {authtypes.Minter, authtypes.Burner},
}
)

Expand Down Expand Up @@ -174,6 +179,7 @@ type GaiaApp struct { // nolint: golint
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
AuthzKeeper authzkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -315,6 +321,11 @@ func NewGaiaApp(
appCodec, keys[feegranttypes.StoreKey], &app.AccountKeeper,
)
app.FeeGrantKeeper = feegrantKeeper

authzKeeper := authzkeeper.NewKeeper(
keys[authztypes.StoreKey],appCodec, app.MsgServiceRouter(),
)
app.AuthzKeeper = authzKeeper
/**** Module Options ****/

/**** Module Options ****/
Expand Down Expand Up @@ -347,6 +358,7 @@ func NewGaiaApp(
upgrade.NewAppModule(app.UpgradeKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
feegrant.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
authz.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
ibc.NewAppModule(app.IBCKeeper),
params.NewAppModule(app.ParamsKeeper),
transferModule,
Expand All @@ -360,7 +372,9 @@ func NewGaiaApp(
upgradetypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName,
)
app.mm.SetOrderEndBlockers(crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, feegranttypes.ModuleName)
app.mm.SetOrderEndBlockers(crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, feegranttypes.ModuleName,
authztypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
// properly initialized with tokens from genesis accounts.
Expand All @@ -371,6 +385,7 @@ func NewGaiaApp(
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName,
slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName,
ibchost.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, ibctransfertypes.ModuleName, feegranttypes.ModuleName,
authztypes.ModuleName,
)

app.mm.RegisterInvariants(&app.CrisisKeeper)
Expand Down Expand Up @@ -611,6 +626,8 @@ func initParamsKeeper(appCodec codec.BinaryMarshaler, legacyAmino *codec.LegacyA
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)
paramsKeeper.Subspace(feegranttypes.ModuleName)
paramsKeeper.Subspace(authztypes.ModuleName)

return paramsKeeper
}
5 changes: 5 additions & 0 deletions cmd/gaiad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
"github.com/cosmos/cosmos-sdk/x/auth/types"
vestingcli "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli"
authzcli "github.com/cosmos/cosmos-sdk/x/authz/client/cli"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
feegrantcli "github.com/cosmos/cosmos-sdk/x/feegrant/client/cli"
Expand Down Expand Up @@ -111,6 +113,7 @@ func queryCommand() *cobra.Command {
authcmd.QueryTxsByEventsCmd(),
authcmd.QueryTxCmd(),
feegrantcli.GetQueryCmd(),
authzcli.GetQueryCmd(),
)

gaia.ModuleBasics.AddQueryCommands(cmd)
Expand Down Expand Up @@ -139,7 +142,9 @@ func txCommand() *cobra.Command {
authcmd.GetEncodeCommand(),
authcmd.GetDecodeCommand(),
flags.LineBreak,
vestingcli.GetTxCmd(),
feegrantcli.GetTxCmd(),
authzcli.GetTxCmd(),
)

gaia.ModuleBasics.AddTxCommands(cmd)
Expand Down

0 comments on commit 399a209

Please sign in to comment.