mirror of https://github.com/certusone/wasmd.git
Merge pull request #213 from CosmWasm/fix-recursive-queries
fixed recursive queries losing context
This commit is contained in:
commit
04cfcdc1da
|
@ -82,7 +82,7 @@ func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace params.Subspa
|
||||||
authZPolicy: DefaultAuthorizationPolicy{},
|
authZPolicy: DefaultAuthorizationPolicy{},
|
||||||
paramSpace: paramSpace,
|
paramSpace: paramSpace,
|
||||||
}
|
}
|
||||||
keeper.queryPlugins = DefaultQueryPlugins(bankKeeper, stakingKeeper, keeper).Merge(customPlugins)
|
keeper.queryPlugins = DefaultQueryPlugins(bankKeeper, stakingKeeper, &keeper).Merge(customPlugins)
|
||||||
return keeper
|
return keeper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ type QueryPlugins struct {
|
||||||
Wasm func(ctx sdk.Context, request *wasmTypes.WasmQuery) ([]byte, error)
|
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{
|
return QueryPlugins{
|
||||||
Bank: BankQuerier(bank),
|
Bank: BankQuerier(bank),
|
||||||
Custom: NoCustomQuerier,
|
Custom: NoCustomQuerier,
|
||||||
|
@ -225,7 +225,7 @@ func sdkToFullDelegation(ctx sdk.Context, keeper staking.Keeper, delegation stak
|
||||||
}, nil
|
}, 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) {
|
return func(ctx sdk.Context, request *wasmTypes.WasmQuery) ([]byte, error) {
|
||||||
if request.Smart != nil {
|
if request.Smart != nil {
|
||||||
addr, err := sdk.AccAddressFromBech32(request.Smart.ContractAddr)
|
addr, err := sdk.AccAddressFromBech32(request.Smart.ContractAddr)
|
||||||
|
|
Loading…
Reference in New Issue