Skip to content

Commit

Permalink
fix: disable custom querier
Browse files Browse the repository at this point in the history
  • Loading branch information
loloicci committed Feb 26, 2024
1 parent 0b88522 commit f58f7ba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 47 deletions.
26 changes: 1 addition & 25 deletions x/wasm/keeper/query_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func DefaultQueryPlugins(
) QueryPlugins {
return QueryPlugins{
Bank: BankQuerier(bank),
Custom: CustomQuerierImpl(queryRouter),
Custom: NoCustomQuerier,
IBC: IBCQuerier(wasm, channelKeeper),
Staking: StakingQuerier(staking, distKeeper),
Stargate: RejectStargateQuerier(),
Expand Down Expand Up @@ -209,30 +209,6 @@ func NoCustomQuerier(sdk.Context, json.RawMessage) ([]byte, error) {
return nil, wasmvmtypes.UnsupportedRequest{Kind: "custom"}
}

func CustomQuerierImpl(queryRouter GRPCQueryRouter) func(ctx sdk.Context, querierJson json.RawMessage) ([]byte, error) {
return func(ctx sdk.Context, querierJson json.RawMessage) ([]byte, error) {
var linkQueryWrapper types.LinkQueryWrapper
err := json.Unmarshal(querierJson, &linkQueryWrapper)
if err != nil {
return nil, err
}
route := queryRouter.Route(linkQueryWrapper.Path)
if route == nil {
return nil, wasmvmtypes.UnsupportedRequest{Kind: "Unknown encode module"}
}
req := abci.RequestQuery{
Data: linkQueryWrapper.Data,
Path: linkQueryWrapper.Path,
}
res, err := route(ctx, req)
if err != nil {
return nil, err
}

return res.Value, nil
}
}

func IBCQuerier(wasm contractMetaDataSource, channelKeeper types.ChannelKeeper) func(ctx sdk.Context, caller sdk.AccAddress, request *wasmvmtypes.IBCQuery) ([]byte, error) {
return func(ctx sdk.Context, caller sdk.AccAddress, request *wasmvmtypes.IBCQuery) ([]byte, error) {
if request.PortID != nil {
Expand Down
22 changes: 0 additions & 22 deletions x/wasm/types/encoder.go

This file was deleted.

0 comments on commit f58f7ba

Please sign in to comment.