Skip to content

Commit

Permalink
chore: register interface in setup test for ecocredit module
Browse files Browse the repository at this point in the history
  • Loading branch information
JeancarloBarrios committed Jul 1, 2024
1 parent 6c40dd4 commit 0344d4f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions x/ecocredit/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ func setup(t *testing.T) (fixture.Factory, bankkeeper.BaseKeeper, authkeeper.Acc
baseApp.MountStore(paramsKey, storetypes.StoreTypeIAVL)
baseApp.MountStore(tkey, storetypes.StoreTypeTransient)

authSubspace := paramstypes.NewSubspace(cdc, amino, paramsKey, tkey, authtypes.ModuleName)
bankSubspace := paramstypes.NewSubspace(cdc, amino, paramsKey, tkey, banktypes.ModuleName)
ecocreditSubspace := paramstypes.NewSubspace(cdc, amino, paramsKey, tkey, ecocredit.ModuleName)

maccPerms := map[string][]string{
Expand All @@ -73,16 +71,20 @@ func setup(t *testing.T) (fixture.Factory, bankkeeper.BaseKeeper, authkeeper.Acc
marketplace.FeePoolName: {authtypes.Burner},
}

authority := authtypes.NewModuleAddress(govtypes.ModuleName)
accountKeeper := authkeeper.NewAccountKeeper(
cdc, authKey, authSubspace, authtypes.ProtoBaseAccount, maccPerms, "regen",
cdc,
authKey,
authtypes.ProtoBaseAccount,
maccPerms,
"regen",
authority.String(),
)

bankKeeper := bankkeeper.NewBaseKeeper(
cdc, bankKey, accountKeeper, bankSubspace, nil,
)
bankKeeper := bankkeeper.NewBaseKeeper(cdc, bankKey, accountKeeper, nil, authority.String())

authority := authtypes.NewModuleAddress(govtypes.ModuleName)
ecocreditModule := module.NewModule(ecoKey, authority, accountKeeper, bankKeeper, ecocreditSubspace, nil)
ecocreditModule.RegisterInterfaces(cdc.InterfaceRegistry())
ff.SetModules([]sdkmodule.AppModule{ecocreditModule})

return ff, bankKeeper, accountKeeper
Expand Down

0 comments on commit 0344d4f

Please sign in to comment.