-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: depinject without app.yaml (#12394)
- Loading branch information
1 parent
fef4632
commit 99b21ab
Showing
8 changed files
with
303 additions
and
250 deletions.
There are no files selected for viewing
188 changes: 93 additions & 95 deletions
188
...osmos/group/v1/module/v1/module.pulsar.go → api/cosmos/group/module/v1/module.pulsar.go
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
proto/cosmos/group/v1/module/v1/module.proto → proto/cosmos/group/module/v1/module.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
package simapp | ||
|
||
import ( | ||
"time" | ||
|
||
"google.golang.org/protobuf/types/known/durationpb" | ||
|
||
"cosmossdk.io/core/appconfig" | ||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" | ||
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" | ||
"github.com/cosmos/cosmos-sdk/x/authz" | ||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" | ||
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" | ||
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" | ||
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" | ||
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" | ||
"github.com/cosmos/cosmos-sdk/x/feegrant" | ||
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" | ||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" | ||
"github.com/cosmos/cosmos-sdk/x/group" | ||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" | ||
"github.com/cosmos/cosmos-sdk/x/nft" | ||
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" | ||
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" | ||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
|
||
runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" | ||
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" | ||
authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" | ||
authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1" | ||
bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" | ||
capabilitymodulev1 "cosmossdk.io/api/cosmos/capability/module/v1" | ||
distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" | ||
evidencemodulev1 "cosmossdk.io/api/cosmos/evidence/module/v1" | ||
feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" | ||
genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" | ||
groupmodulev1 "cosmossdk.io/api/cosmos/group/module/v1" | ||
mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" | ||
nftmodulev1 "cosmossdk.io/api/cosmos/nft/module/v1" | ||
paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" | ||
slashingmodulev1 "cosmossdk.io/api/cosmos/slashing/module/v1" | ||
stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" | ||
txmodulev1 "cosmossdk.io/api/cosmos/tx/module/v1" | ||
upgrademodulev1 "cosmossdk.io/api/cosmos/upgrade/module/v1" | ||
vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" | ||
) | ||
|
||
var AppConfig = appconfig.Compose(&appv1alpha1.Config{ | ||
Modules: []*appv1alpha1.ModuleConfig{ | ||
{ | ||
Name: "runtime", | ||
Config: appconfig.WrapAny(&runtimev1alpha1.Module{ | ||
AppName: "SimApp", | ||
// During begin block slashing happens after distr.BeginBlocker so that | ||
// there is nothing left over in the validator fee pool, so as to keep the | ||
// CanWithdrawInvariant invariant. | ||
// NOTE: staking module is required if HistoricalEntries param > 0 | ||
// NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) | ||
BeginBlockers: []string{ | ||
upgradetypes.ModuleName, | ||
capabilitytypes.ModuleName, | ||
minttypes.ModuleName, | ||
distrtypes.ModuleName, | ||
slashingtypes.ModuleName, | ||
evidencetypes.ModuleName, | ||
stakingtypes.ModuleName, | ||
authtypes.ModuleName, | ||
banktypes.ModuleName, | ||
govtypes.ModuleName, | ||
crisistypes.ModuleName, | ||
genutiltypes.ModuleName, | ||
authz.ModuleName, | ||
feegrant.ModuleName, | ||
nft.ModuleName, | ||
group.ModuleName, | ||
paramstypes.ModuleName, | ||
vestingtypes.ModuleName, | ||
}, | ||
EndBlockers: []string{ | ||
crisistypes.ModuleName, | ||
govtypes.ModuleName, | ||
stakingtypes.ModuleName, | ||
capabilitytypes.ModuleName, | ||
authtypes.ModuleName, | ||
banktypes.ModuleName, | ||
distrtypes.ModuleName, | ||
slashingtypes.ModuleName, | ||
minttypes.ModuleName, | ||
genutiltypes.ModuleName, | ||
evidencetypes.ModuleName, | ||
authz.ModuleName, | ||
feegrant.ModuleName, | ||
nft.ModuleName, | ||
group.ModuleName, | ||
paramstypes.ModuleName, | ||
upgradetypes.ModuleName, | ||
vestingtypes.ModuleName, | ||
}, | ||
OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{ | ||
{ | ||
ModuleName: authtypes.ModuleName, | ||
KvStoreKey: "acc", | ||
}, | ||
}, | ||
}), | ||
}, | ||
{ | ||
Name: authtypes.ModuleName, | ||
Config: appconfig.WrapAny(&authmodulev1.Module{ | ||
Bech32Prefix: "cosmos", | ||
ModuleAccountPermissions: []*authmodulev1.ModuleAccountPermission{ | ||
{Account: authtypes.FeeCollectorName}, | ||
{Account: distrtypes.ModuleName}, | ||
{Account: minttypes.ModuleName, Permissions: []string{authtypes.Minter}}, | ||
{Account: stakingtypes.BondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}}, | ||
{Account: stakingtypes.NotBondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}}, | ||
{Account: govtypes.ModuleName, Permissions: []string{authtypes.Burner}}, | ||
{Account: nft.ModuleName}, | ||
}, | ||
}), | ||
}, | ||
|
||
{ | ||
Name: vestingtypes.ModuleName, | ||
Config: appconfig.WrapAny(&vestingmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: banktypes.ModuleName, | ||
Config: appconfig.WrapAny(&bankmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: stakingtypes.ModuleName, | ||
Config: appconfig.WrapAny(&stakingmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: slashingtypes.ModuleName, | ||
Config: appconfig.WrapAny(&slashingmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: paramstypes.ModuleName, | ||
Config: appconfig.WrapAny(¶msmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: "tx", | ||
Config: appconfig.WrapAny(&txmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: genutiltypes.ModuleName, | ||
Config: appconfig.WrapAny(&genutilmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: authz.ModuleName, | ||
Config: appconfig.WrapAny(&authzmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: upgradetypes.ModuleName, | ||
Config: appconfig.WrapAny(&upgrademodulev1.Module{}), | ||
}, | ||
{ | ||
Name: distrtypes.ModuleName, | ||
Config: appconfig.WrapAny(&distrmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: capabilitytypes.ModuleName, | ||
Config: appconfig.WrapAny(&capabilitymodulev1.Module{ | ||
SealKeeper: true, | ||
}), | ||
}, | ||
{ | ||
Name: evidencetypes.ModuleName, | ||
Config: appconfig.WrapAny(&evidencemodulev1.Module{}), | ||
}, | ||
{ | ||
Name: minttypes.ModuleName, | ||
Config: appconfig.WrapAny(&mintmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: group.ModuleName, | ||
Config: appconfig.WrapAny(&groupmodulev1.Module{ | ||
MaxExecutionPeriod: durationpb.New(time.Second * 1209600), | ||
MaxMetadataLen: 255, | ||
}), | ||
}, | ||
{ | ||
Name: nft.ModuleName, | ||
Config: appconfig.WrapAny(&nftmodulev1.Module{}), | ||
}, | ||
{ | ||
Name: feegrant.ModuleName, | ||
Config: appconfig.WrapAny(&feegrantmodulev1.Module{}), | ||
}, | ||
}, | ||
}) | ||
|
||
// Alternatively this configuration can be set as yaml or json: https://github.com/cosmos/cosmos-sdk/blob/91b1d83f1339e235a1dfa929ecc00084101a19e3/simapp/app.yaml |
Oops, something went wrong.