Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #95 from mycel-domain/feat/furnace
Browse files Browse the repository at this point in the history
Furnace Module
  • Loading branch information
yujiym authored Oct 12, 2023
2 parents 32ade09 + d1552f7 commit e7eb82f
Show file tree
Hide file tree
Showing 67 changed files with 6,797 additions and 18 deletions.
49 changes: 41 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ import (
epochsmodulekeeper "github.com/mycel-domain/mycel/x/epochs/keeper"
epochsmoduletypes "github.com/mycel-domain/mycel/x/epochs/types"

furnacemodule "github.com/mycel-domain/mycel/x/furnace"
furnacemodulekeeper "github.com/mycel-domain/mycel/x/furnace/keeper"
furnacemoduletypes "github.com/mycel-domain/mycel/x/furnace/types"
resolvermodule "github.com/mycel-domain/mycel/x/resolver"
resolvermodulekeeper "github.com/mycel-domain/mycel/x/resolver/keeper"
resolvermoduletypes "github.com/mycel-domain/mycel/x/resolver/types"
Expand Down Expand Up @@ -236,6 +239,7 @@ var (
registrymodule.AppModuleBasic{},
epochsmodule.AppModuleBasic{},
resolvermodule.AppModuleBasic{},
furnacemodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
)

Expand All @@ -253,6 +257,7 @@ var (
wasmtypes.ModuleName: {authtypes.Burner},
// my modules
registrymoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
furnacemoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
// this line is used by starport scaffolding # stargate/app/maccPerms
}
)
Expand Down Expand Up @@ -323,6 +328,8 @@ type App struct {
EpochsKeeper epochsmodulekeeper.Keeper

ResolverKeeper resolvermodulekeeper.Keeper

FurnaceKeeper furnacemodulekeeper.Keeper
// this line is used by starport scaffolding # stargate/app/keeperDeclaration

// mm is the module manager
Expand Down Expand Up @@ -410,6 +417,7 @@ func NewApp(
registrymoduletypes.StoreKey,
epochsmoduletypes.StoreKey,
resolvermoduletypes.StoreKey,
furnacemoduletypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down Expand Up @@ -671,21 +679,22 @@ func NewApp(
),
)

// my modules
// My module's keepers
app.EpochsKeeper = *epochsmodulekeeper.NewKeeper(
appCodec,
keys[epochsmoduletypes.StoreKey],
keys[epochsmoduletypes.MemStoreKey],
app.GetSubspace(epochsmoduletypes.ModuleName),
)

app.EpochsKeeper.SetHooks(
epochsmoduletypes.NewMultiEpochHooks(
app.RegistryKeeper.Hooks(),
// insert hooks here
))
app.ResolverKeeper = *resolvermodulekeeper.NewKeeper(
appCodec,
keys[resolvermoduletypes.StoreKey],
keys[resolvermoduletypes.MemStoreKey],
app.GetSubspace(resolvermoduletypes.ModuleName),

epochsModule := epochsmodule.NewAppModule(appCodec, app.EpochsKeeper, app.AccountKeeper, app.BankKeeper)
app.RegistryKeeper,
)

app.RegistryKeeper = *registrymodulekeeper.NewKeeper(
appCodec,
Expand All @@ -695,7 +704,6 @@ func NewApp(

app.BankKeeper,
)
registryModule := registrymodule.NewAppModule(appCodec, app.RegistryKeeper, app.AccountKeeper, app.BankKeeper)

app.ResolverKeeper = *resolvermodulekeeper.NewKeeper(
appCodec,
Expand All @@ -705,7 +713,27 @@ func NewApp(

app.RegistryKeeper,
)

app.FurnaceKeeper = *furnacemodulekeeper.NewKeeper(
appCodec,
keys[furnacemoduletypes.StoreKey],
keys[furnacemoduletypes.MemStoreKey],
app.GetSubspace(furnacemoduletypes.ModuleName),

app.BankKeeper,
app.EpochsKeeper,
)

app.EpochsKeeper.SetHooks(
epochsmoduletypes.NewMultiEpochHooks(
// insert hooks here
app.FurnaceKeeper.Hooks(),
))

epochsModule := epochsmodule.NewAppModule(appCodec, app.EpochsKeeper, app.AccountKeeper, app.BankKeeper)
registryModule := registrymodule.NewAppModule(appCodec, app.RegistryKeeper, app.AccountKeeper, app.BankKeeper)
resolverModule := resolvermodule.NewAppModule(appCodec, app.ResolverKeeper, app.AccountKeeper, app.BankKeeper)
furnaceModule := furnacemodule.NewAppModule(appCodec, app.FurnaceKeeper, app.AccountKeeper, app.BankKeeper)

// this line is used by starport scaffolding # stargate/app/keeperDefinition

Expand Down Expand Up @@ -774,6 +802,7 @@ func NewApp(
registryModule,
epochsModule,
resolverModule,
furnaceModule,
// this line is used by starport scaffolding # stargate/app/appModule

crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
Expand Down Expand Up @@ -812,6 +841,7 @@ func NewApp(
registrymoduletypes.ModuleName,
epochsmoduletypes.ModuleName,
resolvermoduletypes.ModuleName,
furnacemoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
)

Expand Down Expand Up @@ -843,6 +873,7 @@ func NewApp(
registrymoduletypes.ModuleName,
epochsmoduletypes.ModuleName,
resolvermoduletypes.ModuleName,
furnacemoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/endBlockers
)

Expand Down Expand Up @@ -880,6 +911,7 @@ func NewApp(
registrymoduletypes.ModuleName,
epochsmoduletypes.ModuleName,
resolvermoduletypes.ModuleName,
furnacemoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
}
app.mm.SetOrderInitGenesis(genesisModuleOrder...)
Expand Down Expand Up @@ -1143,6 +1175,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(registrymoduletypes.ModuleName)
paramsKeeper.Subspace(epochsmoduletypes.ModuleName)
paramsKeeper.Subspace(resolvermoduletypes.ModuleName)
paramsKeeper.Subspace(furnacemoduletypes.ModuleName)
// this line is used by starport scaffolding # stargate/app/paramSubspace

return paramsKeeper
Expand Down
1 change: 0 additions & 1 deletion cmd/myceld/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ func txCommand() *cobra.Command {
return cmd
}


func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd)
// this line is used by starport scaffolding # root/arguments
Expand Down
2 changes: 1 addition & 1 deletion cmd/myceld/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func main() {
rootCmd, _ := cmd.NewRootCmd()

if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil {
switch e := err.(type) {
case server.ErrorCode:
Expand Down
Loading

0 comments on commit e7eb82f

Please sign in to comment.