Skip to content

Commit

Permalink
contract keeper added
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsingh33 committed May 3, 2023
1 parent 1f59a0f commit 3827429
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ type App struct {
PacketForwardKeeper *packetforwardkeeper.Keeper

WasmKeeper wasm.Keeper
ContractKeeper *wasmkeeper.PermissionedKeeper
// the module manager
mm *module.Manager
// Module configurator
Expand Down Expand Up @@ -807,6 +808,11 @@ func New(
wasmOpts...,
)

// Pass the contract keeper to all the structs (generally ICS4Wrappers for ibc middlewares) that need it
app.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper)
app.RateLimitingICS4Wrapper.ContractKeeper = app.ContractKeeper
app.Ics20WasmHooks.ContractKeeper = app.ContractKeeper

// register the proposal types
govRouter := govtypes.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
Expand Down Expand Up @@ -1126,7 +1132,7 @@ func (a *App) WireICS20PreWasmKeeper(
) {
// Setup the ICS4Wrapper used by the hooks middleware
cmdxPrefix := sdk.GetConfig().GetBech32AccountAddrPrefix()
wasmHooks := ibchooks.NewWasmHooks(hooksKeeper, &wasmkeeper.PermissionedKeeper{}, cmdxPrefix) // The contract keeper needs to be set later
wasmHooks := ibchooks.NewWasmHooks(hooksKeeper, nil, cmdxPrefix) // The contract keeper needs to be set later
a.Ics20WasmHooks = &wasmHooks
a.HooksICS4Wrapper = ibchooks.NewICS4Middleware(
a.IbcKeeper.ChannelKeeper,
Expand All @@ -1138,7 +1144,7 @@ func (a *App) WireICS20PreWasmKeeper(
a.HooksICS4Wrapper,
&a.AccountKeeper,
// wasm keeper we set later.
&wasmkeeper.PermissionedKeeper{},
nil,
a.BankBaseKeeper,
a.GetSubspace(ibcratelimittypes.ModuleName),
)
Expand Down

0 comments on commit 3827429

Please sign in to comment.