Skip to content

Commit

Permalink
Merge pull request #213 from CosmWasm/fix-recursive-queries
Browse files Browse the repository at this point in the history
fixed recursive queries losing context
  • Loading branch information
ethanfrey committed Jul 22, 2020
2 parents 6e021d9 + a7f801d commit 04cfcdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x/wasm/internal/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace params.Subspa
authZPolicy: DefaultAuthorizationPolicy{},
paramSpace: paramSpace,
}
keeper.queryPlugins = DefaultQueryPlugins(bankKeeper, stakingKeeper, keeper).Merge(customPlugins)
keeper.queryPlugins = DefaultQueryPlugins(bankKeeper, stakingKeeper, &keeper).Merge(customPlugins)
return keeper
}

Expand Down
4 changes: 2 additions & 2 deletions x/wasm/internal/keeper/query_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type QueryPlugins struct {
Wasm func(ctx sdk.Context, request *wasmTypes.WasmQuery) ([]byte, error)
}

func DefaultQueryPlugins(bank bank.ViewKeeper, staking staking.Keeper, wasm Keeper) QueryPlugins {
func DefaultQueryPlugins(bank bank.ViewKeeper, staking staking.Keeper, wasm *Keeper) QueryPlugins {
return QueryPlugins{
Bank: BankQuerier(bank),
Custom: NoCustomQuerier,
Expand Down Expand Up @@ -225,7 +225,7 @@ func sdkToFullDelegation(ctx sdk.Context, keeper staking.Keeper, delegation stak
}, nil
}

func WasmQuerier(wasm Keeper) func(ctx sdk.Context, request *wasmTypes.WasmQuery) ([]byte, error) {
func WasmQuerier(wasm *Keeper) func(ctx sdk.Context, request *wasmTypes.WasmQuery) ([]byte, error) {
return func(ctx sdk.Context, request *wasmTypes.WasmQuery) ([]byte, error) {
if request.Smart != nil {
addr, err := sdk.AccAddressFromBech32(request.Smart.ContractAddr)
Expand Down

0 comments on commit 04cfcdc

Please sign in to comment.