Skip to content

Commit

Permalink
fix git conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
kenta-elys committed Aug 30, 2023
1 parent fb51cb4 commit 57e4619
Show file tree
Hide file tree
Showing 99 changed files with 7,282 additions and 220 deletions.
36 changes: 36 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ import (
marginmodulekeeper "github.com/elys-network/elys/x/margin/keeper"
marginmoduletypes "github.com/elys-network/elys/x/margin/types"

accountedpoolmodule "github.com/elys-network/elys/x/accountedpool"
accountedpoolmodulekeeper "github.com/elys-network/elys/x/accountedpool/keeper"
accountedpoolmoduletypes "github.com/elys-network/elys/x/accountedpool/types"

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

"github.com/elys-network/elys/docs"
Expand Down Expand Up @@ -257,6 +261,7 @@ var (
ammmodule.AppModuleBasic{},
parametermodule.AppModuleBasic{},
marginmodule.AppModuleBasic{},
accountedpoolmodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
)

Expand Down Expand Up @@ -351,6 +356,8 @@ type ElysApp struct {
AmmKeeper ammmodulekeeper.Keeper
ParameterKeeper parametermodulekeeper.Keeper
MarginKeeper marginmodulekeeper.Keeper

AccountedPoolKeeper accountedpoolmodulekeeper.Keeper
// this line is used by starport scaffolding # stargate/app/keeperDeclaration

// mm is the module manager
Expand Down Expand Up @@ -418,6 +425,7 @@ func NewElysApp(
ammmoduletypes.StoreKey,
parametermoduletypes.StoreKey,
marginmoduletypes.StoreKey,
accountedpoolmoduletypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down Expand Up @@ -677,6 +685,7 @@ func NewElysApp(
app.OracleKeeper,
&app.CommitmentKeeper,
app.AssetprofileKeeper,
app.AccountedPoolKeeper,
)
ammModule := ammmodule.NewAppModule(appCodec, app.AmmKeeper, app.AccountKeeper, app.BankKeeper)

Expand All @@ -691,6 +700,7 @@ func NewElysApp(
app.BankKeeper,
app.AmmKeeper,
app.OracleKeeper,
app.AccountedPoolKeeper,
authtypes.FeeCollectorName,
DexRevenueCollectorName,
)
Expand Down Expand Up @@ -809,9 +819,21 @@ func NewElysApp(
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.AmmKeeper,
app.BankKeeper,
app.AccountedPoolKeeper,
)
marginModule := marginmodule.NewAppModule(appCodec, app.MarginKeeper, app.AccountKeeper, app.BankKeeper)

app.AccountedPoolKeeper = *accountedpoolmodulekeeper.NewKeeper(
appCodec,
keys[accountedpoolmoduletypes.StoreKey],
keys[accountedpoolmoduletypes.MemStoreKey],
app.GetSubspace(accountedpoolmoduletypes.ModuleName),
app.AmmKeeper,
app.MarginKeeper,
app.BankKeeper,
)
accountedPoolModule := accountedpoolmodule.NewAppModule(appCodec, app.AccountedPoolKeeper, app.AccountKeeper, app.BankKeeper)

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

/**** IBC Routing ****/
Expand Down Expand Up @@ -855,6 +877,7 @@ func NewElysApp(
ammmoduletypes.NewMultiAmmHooks(
// insert amm hooks receivers here
app.IncentiveKeeper.AmmHooks(),
app.AccountedPoolKeeper.AmmHooks(),
),
)

Expand All @@ -865,10 +888,18 @@ func NewElysApp(
app.CommitmentKeeper.Hooks(),
app.IncentiveKeeper.Hooks(),
app.BurnerKeeper.Hooks(),
app.AccountedPoolKeeper.Hooks(),
),
)
epochsModule := epochsmodule.NewAppModule(appCodec, app.EpochsKeeper)

app.MarginKeeper.SetHooks(
marginmoduletypes.NewMultiMarginHooks(
// insert margin hooks receivers here
app.AccountedPoolKeeper.MarginHooks(),
),
)

/**** Module Options ****/

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
Expand Down Expand Up @@ -914,6 +945,7 @@ func NewElysApp(
ammModule,
parameterModule,
marginModule,
accountedPoolModule,
// this line is used by starport scaffolding # stargate/app/appModule
)

Expand Down Expand Up @@ -956,6 +988,7 @@ func NewElysApp(
parametermoduletypes.ModuleName,
marginmoduletypes.ModuleName,
wasm.ModuleName,
accountedpoolmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
)

Expand Down Expand Up @@ -993,6 +1026,7 @@ func NewElysApp(
parametermoduletypes.ModuleName,
marginmoduletypes.ModuleName,
wasm.ModuleName,
accountedpoolmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/endBlockers
)

Expand Down Expand Up @@ -1034,6 +1068,7 @@ func NewElysApp(
parametermoduletypes.ModuleName,
marginmoduletypes.ModuleName,
wasm.ModuleName,
accountedpoolmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
}
app.mm.SetOrderInitGenesis(genesisModuleOrder...)
Expand Down Expand Up @@ -1329,6 +1364,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ammmoduletypes.ModuleName)
paramsKeeper.Subspace(parametermoduletypes.ModuleName)
paramsKeeper.Subspace(marginmoduletypes.ModuleName)
paramsKeeper.Subspace(accountedpoolmoduletypes.ModuleName)
// this line is used by starport scaffolding # stargate/app/paramSubspace

return paramsKeeper
Expand Down
3 changes: 3 additions & 0 deletions app/setup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
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"
accountedpooltypes "github.com/elys-network/elys/x/accountedpool/types"
ammtypes "github.com/elys-network/elys/x/amm/types"
assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types"
burnertypes "github.com/elys-network/elys/x/burner/types"
Expand Down Expand Up @@ -77,6 +78,8 @@ func setUpgradeHandler(app *ElysApp) {
keyTable = parametertypes.ParamKeyTable() //nolint:staticcheck
case tokenomicstypes.ModuleName:
keyTable = tokenomicstypes.ParamKeyTable() //nolint:staticcheck
case accountedpooltypes.ModuleName:
keyTable = accountedpooltypes.ParamKeyTable() //nolint:staticcheck
}

if !subspace.HasKeyTable() {
Expand Down
Loading

0 comments on commit 57e4619

Please sign in to comment.