feat: migrate x/feegrant to app wiring (#12090)

* feat: migrate x/feegrant to app witing

* add missing bank keeper
This commit is contained in:
Facundo Medica
2022-06-02 21:17:57 +02:00
committed by GitHub
parent 17232fa89b
commit fe5c22ebd5
7 changed files with 573 additions and 12 deletions
+3 -5
View File
@@ -223,6 +223,7 @@ func NewSimApp(
&app.interfaceRegistry,
&app.AccountKeeper,
&app.BankKeeper,
&app.FeeGrantKeeper,
)
if err != nil {
panic(err)
@@ -233,8 +234,8 @@ func NewSimApp(
app.keys = sdk.NewKVStoreKeys(
stakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey,
slashingtypes.StoreKey, govtypes.StoreKey, upgradetypes.StoreKey,
feegrant.StoreKey, evidencetypes.StoreKey, authzkeeper.StoreKey,
nftkeeper.StoreKey, group.StoreKey,
evidencetypes.StoreKey, authzkeeper.StoreKey, nftkeeper.StoreKey,
group.StoreKey,
)
// NOTE: The testingkey is just mounted for testing purposes. Actual applications should
// not include this key.
@@ -267,8 +268,6 @@ func NewSimApp(
app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName,
)
app.FeeGrantKeeper = feegrantkeeper.NewKeeper(app.appCodec, app.keys[feegrant.StoreKey], app.AccountKeeper)
// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
app.StakingKeeper = *stakingKeeper.SetHooks(
@@ -332,7 +331,6 @@ func NewSimApp(
),
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants),
feegrantmodule.NewAppModule(app.appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
gov.NewAppModule(app.appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
mint.NewAppModule(app.appCodec, app.MintKeeper, app.AccountKeeper, nil),
slashing.NewAppModule(app.appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
+5 -1
View File
@@ -47,6 +47,10 @@ modules:
config:
"@type": cosmos.params.module.v1.Module
- name: feegrant
config:
"@type": cosmos.feegrant.module.v1.Module
- name: bank
config:
"@type": cosmos.bank.module.v1.Module
@@ -54,4 +58,4 @@ modules:
- name: capability
config:
"@type": cosmos.capability.module.v1.Module
seal_keeper: true
seal_keeper: true