Skip to content

Commit

Permalink
chore(data-proxy): wire data-proxy module into app
Browse files Browse the repository at this point in the history
Part-of: #316
  • Loading branch information
Thomasvdam committed Aug 17, 2024
1 parent 30b17b2 commit 2ddb4d1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ import (
"github.com/sedaprotocol/seda-chain/app/keepers"
appparams "github.com/sedaprotocol/seda-chain/app/params"
"github.com/sedaprotocol/seda-chain/docs"
dataproxy "github.com/sedaprotocol/seda-chain/x/data-proxy"
dataproxykeeper "github.com/sedaprotocol/seda-chain/x/data-proxy/keeper"
dataproxytypes "github.com/sedaprotocol/seda-chain/x/data-proxy/types"
"github.com/sedaprotocol/seda-chain/x/staking"
stakingkeeper "github.com/sedaprotocol/seda-chain/x/staking/keeper"
"github.com/sedaprotocol/seda-chain/x/tally"
Expand Down Expand Up @@ -182,6 +185,7 @@ var (
packetforward.AppModuleBasic{},
wasmstorage.AppModuleBasic{},
tally.AppModuleBasic{},
dataproxy.AppModuleBasic{},
)

// module account permissions
Expand Down Expand Up @@ -238,6 +242,7 @@ type App struct {
// SEDA modules keepers
WasmStorageKeeper wasmstoragekeeper.Keeper
TallyKeeper tallykeeper.Keeper
DataProxyKeeper dataproxykeeper.Keeper

mm *module.Manager
bmm module.BasicManager
Expand Down Expand Up @@ -302,7 +307,7 @@ func NewApp(
feegrant.StoreKey, evidencetypes.StoreKey, circuittypes.StoreKey, authzkeeper.StoreKey, group.StoreKey,
capabilitytypes.StoreKey, ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey,
wasmtypes.StoreKey, icahosttypes.StoreKey, icacontrollertypes.StoreKey, packetforwardtypes.StoreKey,
crisistypes.StoreKey, wasmstoragetypes.StoreKey,
crisistypes.StoreKey, wasmstoragetypes.StoreKey, dataproxytypes.StoreKey,
)

memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -624,6 +629,8 @@ func NewApp(

app.TallyKeeper = tallykeeper.NewKeeper(app.WasmStorageKeeper, contractKeeper, app.WasmKeeper)

app.DataProxyKeeper = *dataproxykeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[dataproxytypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String())

/* =================================================== */
/* TRANSFER STACK */
/* =================================================== */
Expand Down Expand Up @@ -737,6 +744,7 @@ func NewApp(
packetforward.NewAppModule(app.PacketForwardKeeper, nil),
wasmstorage.NewAppModule(appCodec, app.WasmStorageKeeper),
tally.NewAppModule(app.TallyKeeper),
dataproxy.NewAppModule(appCodec, app.DataProxyKeeper),
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, nil), // always be last to make sure that it checks for all invariants and not only part of them
)

Expand Down Expand Up @@ -793,6 +801,7 @@ func NewApp(
// custom modules
wasmstoragetypes.ModuleName,
tallytypes.ModuleName,
dataproxytypes.ModuleName,
)

app.mm.SetOrderEndBlockers(
Expand Down Expand Up @@ -823,6 +832,7 @@ func NewApp(
// custom modules
wasmstoragetypes.ModuleName,
tallytypes.ModuleName,
dataproxytypes.ModuleName,
)

// NOTE: The genutils module must occur after sdkstaking so that pools are
Expand Down Expand Up @@ -859,6 +869,7 @@ func NewApp(
// custom modules
wasmstoragetypes.ModuleName,
tallytypes.ModuleName,
dataproxytypes.ModuleName,
}
app.mm.SetOrderInitGenesis(genesisModuleOrder...)
app.mm.SetOrderExportGenesis(genesisModuleOrder...)
Expand Down

0 comments on commit 2ddb4d1

Please sign in to comment.