Skip to content

Commit

Permalink
[#351] Add fixed fee for creating a new credit class
Browse files Browse the repository at this point in the history
  • Loading branch information
ruhatch committed Jun 7, 2021
1 parent fa967f8 commit 34df62b
Show file tree
Hide file tree
Showing 13 changed files with 1,446 additions and 825 deletions.
14 changes: 13 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import (
distr "github.com/cosmos/cosmos-sdk/x/distribution"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
ecocreditkeeper "github.com/regen-network/regen-ledger/x/ecocredit/keeper"
ecocreditmodule "github.com/regen-network/regen-ledger/x/ecocredit/module"
"github.com/cosmos/cosmos-sdk/x/evidence"
evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
Expand Down Expand Up @@ -125,6 +127,7 @@ var (
vesting.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
authzmodule.AppModuleBasic{},
ecocreditmodule.Module{},
}, setCustomModuleBasics()...)...,
)

Expand Down Expand Up @@ -176,6 +179,7 @@ type RegenApp struct {
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
EcocreditKeeper ecocreditkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -220,7 +224,7 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, feegrant.StoreKey,
authzkeeper.StoreKey,
authzkeeper.StoreKey, ecocreditmodule.Module{}.Name(),
}, setCustomKVStoreKeys()...)...,
)

Expand Down Expand Up @@ -340,6 +344,12 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
&stakingKeeper, govRouter,
)

app.EcocreditKeeper = ecocreditkeeper.NewKeeper(
keys[ecocreditmodule.Module{}.Name()],
appCodec,
app.GetSubspace(ecocreditmodule.Module{}.Name()),
)

// register experimental modules here
app.smm = setCustomModules(app, interfaceRegistry)
app.smm.RegisterInvariants(&app.CrisisKeeper)
Expand Down Expand Up @@ -369,6 +379,7 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
ibc.NewAppModule(app.IBCKeeper),
params.NewAppModule(app.ParamsKeeper),
transferModule,
ecocreditmodule.NewModule(app.EcocreditKeeper),
}, app.setCustomModuleManager()...)...,
)

Expand Down Expand Up @@ -641,6 +652,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)
paramsKeeper.Subspace(ecocreditmodule.Module{}.Name())
initCustomParamsKeeper(&paramsKeeper)

return paramsKeeper
Expand Down
Loading

0 comments on commit 34df62b

Please sign in to comment.