Skip to content

Commit

Permalink
Merge pull request #216 from facundomedica/facu/fix-obc
Browse files Browse the repository at this point in the history
fix IBC + little app.go cleanup
  • Loading branch information
themandalore authored Jul 19, 2024
2 parents 5fa81ef + 802eccd commit decbd28
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
ibcporttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
"github.com/spf13/cast"
_ "github.com/tellor-io/layer/app/config"
appflags "github.com/tellor-io/layer/app/flags"
Expand Down Expand Up @@ -489,7 +490,6 @@ func New(
scopedTransferKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
transferModule := transfer.NewAppModule(app.TransferKeeper)
transferIBCModule := transfer.NewIBCModule(app.TransferKeeper)

app.ICAHostKeeper = icahostkeeper.NewKeeper(
Expand All @@ -511,7 +511,7 @@ func New(
scopedICAControllerKeeper, app.MsgServiceRouter(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
icaModule := ica.NewAppModule(&icaControllerKeeper, &app.ICAHostKeeper)

icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper)

// Create evidence Keeper for to register the IBC light client misbehavior evidence route
Expand Down Expand Up @@ -550,7 +550,6 @@ func New(
runtime.NewKVStoreService(keys[registrymoduletypes.StoreKey]),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
registryModule := registrymodule.NewAppModule(appCodec, app.RegistryKeeper, app.AccountKeeper, app.BankKeeper)

app.ReporterKeeper = reportermodulekeeper.NewKeeper(
appCodec,
Expand All @@ -561,7 +560,6 @@ func New(
app.BankKeeper,
app.RegistryKeeper,
)
reporterModule := reportermodule.NewAppModule(appCodec, app.ReporterKeeper, app.AccountKeeper, app.BankKeeper)

app.OracleKeeper = oraclemodulekeeper.NewKeeper(
appCodec,
Expand All @@ -572,7 +570,6 @@ func New(
app.ReporterKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
oracleModule := oraclemodule.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper)

app.DisputeKeeper = disputemodulekeeper.NewKeeper(
appCodec,
Expand All @@ -582,7 +579,6 @@ func New(
app.OracleKeeper,
app.ReporterKeeper,
)
disputeModule := disputemodule.NewAppModule(appCodec, app.DisputeKeeper, app.AccountKeeper, app.BankKeeper)

app.BridgeKeeper = bridgemodulekeeper.NewKeeper(
appCodec,
Expand All @@ -593,7 +589,6 @@ func New(
app.BankKeeper,
app.ReporterKeeper,
)
bridgeModule := bridgemodule.NewAppModule(appCodec, app.BridgeKeeper, app.AccountKeeper, app.BankKeeper)

// this line is used by starport scaffolding # stargate/app/keeperDefinition
appFlags := appflags.GetFlagValuesFromOptions(appOpts)
Expand Down Expand Up @@ -763,21 +758,26 @@ func New(
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, nil),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil, app.interfaceRegistry),
distrModule{distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil)},
stakingModule{staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, nil)},
upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()),
evidence.NewAppModule(app.EvidenceKeeper),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),

// Layer modules
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
oraclemodule.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
registrymodule.NewAppModule(appCodec, app.RegistryKeeper, app.AccountKeeper, app.BankKeeper),
disputemodule.NewAppModule(appCodec, app.DisputeKeeper, app.AccountKeeper, app.BankKeeper),
bridgemodule.NewAppModule(appCodec, app.BridgeKeeper, app.AccountKeeper, app.BankKeeper),
reportermodule.NewAppModule(appCodec, app.ReporterKeeper, app.AccountKeeper, app.BankKeeper),

// IBC modules
ibctm.AppModule{},
ibc.NewAppModule(app.IBCKeeper),
transferModule,
icaModule,
oracleModule,
registryModule,
disputeModule,
bridgeModule,
reporterModule,
transfer.NewAppModule(app.TransferKeeper),
ica.NewAppModule(&icaControllerKeeper, &app.ICAHostKeeper),
// this line is used by starport scaffolding # stargate/app/appModule
)

Expand Down Expand Up @@ -810,7 +810,6 @@ func New(
authtypes.ModuleName,
banktypes.ModuleName,
govtypes.ModuleName,
ibctransfertypes.ModuleName,
ibcexported.ModuleName,
icatypes.ModuleName,
genutiltypes.ModuleName,
Expand Down

0 comments on commit decbd28

Please sign in to comment.