diff --git a/app/app.go b/app/app.go index 8564d5f0..96e73695 100644 --- a/app/app.go +++ b/app/app.go @@ -519,7 +519,7 @@ func NewMigalooApp( app.IBCHooksKeeper = &hooksKeeper migalooPrefix := sdk.GetConfig().GetBech32AccountAddrPrefix() - wasmHooks := ibchooks.NewWasmHooks(app.IBCHooksKeeper, app.ContractKeeper, wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper), migalooPrefix) // The contract keeper + wasmHooks := ibchooks.NewWasmHooks(app.IBCHooksKeeper, nil, migalooPrefix) // The contract keeper needs to be set later app.Ics20WasmHooks = &wasmHooks app.HooksICS4Wrapper = ibchooks.NewICS4Middleware( diff --git a/x/ibchooks/wasm_hook.go b/x/ibchooks/wasm_hook.go index b7289499..446c3787 100644 --- a/x/ibchooks/wasm_hook.go +++ b/x/ibchooks/wasm_hook.go @@ -28,15 +28,13 @@ type ContractAck struct { } type WasmHooks struct { - WasmKeeper wasmtypes.ContractOpsKeeper ContractKeeper *wasmkeeper.PermissionedKeeper ibcHooksKeeper *keeper.Keeper bech32PrefixAccAddr string } -func NewWasmHooks(ibcHooksKeeper *keeper.Keeper, contractKeeper *wasmkeeper.PermissionedKeeper, wasmKeeper wasmtypes.ContractOpsKeeper, bech32PrefixAccAddr string) WasmHooks { +func NewWasmHooks(ibcHooksKeeper *keeper.Keeper, contractKeeper *wasmkeeper.PermissionedKeeper, bech32PrefixAccAddr string) WasmHooks { return WasmHooks{ - WasmKeeper: wasmKeeper, ContractKeeper: contractKeeper, ibcHooksKeeper: ibcHooksKeeper, bech32PrefixAccAddr: bech32PrefixAccAddr, @@ -132,7 +130,7 @@ func (h WasmHooks) execWasmMsg(ctx sdk.Context, execMsg *wasmtypes.MsgExecuteCon if err := execMsg.ValidateBasic(); err != nil { return nil, fmt.Errorf(types.ErrBadExecutionMsg, err.Error()) } - wasmMsgServer := wasmkeeper.NewMsgServerImpl(h.WasmKeeper) + wasmMsgServer := wasmkeeper.NewMsgServerImpl(h.ContractKeeper) return wasmMsgServer.ExecuteContract(sdk.WrapSDKContext(ctx), execMsg) }