diff --git a/app/app.go b/app/app.go index c8d6ce22..f1d4362e 100644 --- a/app/app.go +++ b/app/app.go @@ -554,7 +554,7 @@ func New( app.AccountKeeper, app.BankKeeper, ) - logicModule := logicmodule.NewAppModule(appCodec, app.LogicKeeper, app.AccountKeeper, app.BankKeeper) + logicModule := logicmodule.NewAppModule(appCodec, app.LogicKeeper, app.AccountKeeper, app.BankKeeper, app.WasmKeeper) wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOpts) diff --git a/x/logic/module.go b/x/logic/module.go index bd1093df..cd2f8188 100644 --- a/x/logic/module.go +++ b/x/logic/module.go @@ -94,9 +94,10 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { type AppModule struct { AppModuleBasic - keeper keeper.Keeper - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper + wasmVMQueryHandler types.WasmKeeper } func NewAppModule( @@ -104,12 +105,14 @@ func NewAppModule( keeper keeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + wasmVMQueryHandler types.WasmKeeper, ) AppModule { return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + wasmVMQueryHandler: wasmVMQueryHandler, } } diff --git a/x/logic/types/expected_keepers.go b/x/logic/types/expected_keepers.go index abb0f922..68dcabfd 100644 --- a/x/logic/types/expected_keepers.go +++ b/x/logic/types/expected_keepers.go @@ -19,3 +19,8 @@ type BankKeeper interface { SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins } + +// WasmKeeper defines the expected interface needed to request smart contracts. +type WasmKeeper interface { + QuerySmart(ctx sdk.Context, contractAddr sdk.AccAddress, req []byte) ([]byte, error) +}