mirror of https://github.com/certusone/wasmd.git
fixed recursive queries losing context
This commit is contained in:
parent
6e021d9b45
commit
a7f801d123
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue