Skip to content

Commit

Permalink
Revert "Revert "Add Wasmbindings" (#48)"
Browse files Browse the repository at this point in the history
This reverts commit 8bed26f.
  • Loading branch information
soring323 authored Feb 4, 2024
1 parent 8bed26f commit cb7bf8e
Show file tree
Hide file tree
Showing 9 changed files with 20,323 additions and 58,134 deletions.
58 changes: 32 additions & 26 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keepers

import (
"strings"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
Expand Down Expand Up @@ -37,6 +35,8 @@ import (
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
swasm "github.com/sideprotocol/side/wasmbinding"

slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
Expand Down Expand Up @@ -359,30 +359,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper))
govKeeper.SetLegacyRouter(govRouter)

// Create Wasmd Keepers
// this line is used by starport scaffolding # stargate/app/scopedKeeper
availableCapabilities := strings.Join(AllCapabilities(), ",")
appKeepers.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
appKeepers.keys[wasmtypes.StoreKey],
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
appKeepers.StakingKeeper,
distrkeeper.NewQuerier(appKeepers.DistrKeeper),
appKeepers.IBCFeeKeeper,
appKeepers.IBCKeeper.ChannelKeeper,
&appKeepers.IBCKeeper.PortKeeper,
appKeepers.scopedWasmKeeper,
appKeepers.TransferKeeper,
bApp.MsgServiceRouter(),
bApp.GRPCQueryRouter(),
wasmDir,
wasmConfig,
availableCapabilities,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
wasmOpts...,
)

appKeepers.GmmKeeper = *gmmmodulekeeper.NewKeeper(
appCodec,
appKeepers.keys[gmmmoduletypes.StoreKey],
Expand All @@ -405,6 +381,36 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appKeepers.IcacallbacksKeeper,
)

// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
supportedFeatures := "iterator,staking,stargate,side,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_4"

wasmOpts = append(swasm.RegisterCustomPlugins(&appKeepers.BankKeeper, &appKeepers.GmmKeeper), wasmOpts...)

// Create Wasmd Keepers
// this line is used by starport scaffolding # stargate/app/scopedKeeper
// availableCapabilities := strings.Join(AllCapabilities(), ",")
appKeepers.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
appKeepers.keys[wasmtypes.StoreKey],
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
appKeepers.StakingKeeper,
distrkeeper.NewQuerier(appKeepers.DistrKeeper),
appKeepers.IBCFeeKeeper,
appKeepers.IBCKeeper.ChannelKeeper,
&appKeepers.IBCKeeper.PortKeeper,
appKeepers.scopedWasmKeeper,
appKeepers.TransferKeeper,
bApp.MsgServiceRouter(),
bApp.GRPCQueryRouter(),
wasmDir,
wasmConfig,
supportedFeatures,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
wasmOpts...,
)

transferIBCModule := transfer.NewIBCModule(appKeepers.TransferKeeper)
icaHostIBCModule := icahost.NewIBCModule(appKeepers.ICAHostKeeper)

Expand Down
Loading

0 comments on commit cb7bf8e

Please sign in to comment.