diff --git a/app/wasm/query/handle_metoken.go b/app/wasm/query/handle_metoken.go index d664f43332..39278a798d 100644 --- a/app/wasm/query/handle_metoken.go +++ b/app/wasm/query/handle_metoken.go @@ -51,11 +51,11 @@ func (q UmeeQuery) HandleMeTokenIndexBalances( return qs.IndexBalances(ctx, &req) } -// HandleMeTokenIndexPrice handles the get for x/metoken indexe price. -func (q UmeeQuery) HandleMeTokenIndexPrice( +// HandleMeTokenIndexPrices handles the get for x/metoken indexe price. +func (q UmeeQuery) HandleMeTokenIndexPrices( ctx context.Context, qs metoken.QueryServer, ) (proto.Message, error) { - req := metoken.QueryIndexPrices{MetokenDenom: q.IndexPrice.MetokenDenom} + req := metoken.QueryIndexPrices{MetokenDenom: q.IndexPrices.MetokenDenom} return qs.IndexPrices(ctx, &req) } diff --git a/app/wasm/query/plugin.go b/app/wasm/query/plugin.go index 50b8da4d53..c14b297f2e 100644 --- a/app/wasm/query/plugin.go +++ b/app/wasm/query/plugin.go @@ -124,7 +124,7 @@ func (plugin *Plugin) CustomQuerier() func(ctx sdk.Context, request json.RawMess case smartcontractQuery.LastRewardTime != nil: resp, err = smartcontractQuery.HandleLastRewardTime(ctx, plugin.incQueryServer) - // metoken + // metoken case smartcontractQuery.MeTokenParameters != nil: resp, err = smartcontractQuery.HandleMeTokenParams(ctx, plugin.metokenQueryServer) case smartcontractQuery.Indexes != nil: @@ -135,8 +135,8 @@ func (plugin *Plugin) CustomQuerier() func(ctx sdk.Context, request json.RawMess resp, err = smartcontractQuery.HandleMeTokenRedeemFee(ctx, plugin.metokenQueryServer) case smartcontractQuery.IndexBalances != nil: resp, err = smartcontractQuery.HandleMeTokenIndexBalances(ctx, plugin.metokenQueryServer) - case smartcontractQuery.IndexPrice != nil: - resp, err = smartcontractQuery.HandleMeTokenIndexPrice(ctx, plugin.metokenQueryServer) + case smartcontractQuery.IndexPrices != nil: + resp, err = smartcontractQuery.HandleMeTokenIndexPrices(ctx, plugin.metokenQueryServer) default: return nil, wasmvmtypes.UnsupportedRequest{Kind: "invalid umee query"} diff --git a/app/wasm/query/types.go b/app/wasm/query/types.go index 0d2b1ebaba..9660274a27 100644 --- a/app/wasm/query/types.go +++ b/app/wasm/query/types.go @@ -98,7 +98,7 @@ type UmeeQuery struct { SwapFee *metoken.QuerySwapFee `json:"metoken_swapfee,omitempty"` RedeemFee *metoken.QueryRedeemFee `json:"metoken_redeemfee,omitempty"` IndexBalances *metoken.QueryIndexBalances `json:"metoken_indexbalances,omitempty"` - IndexPrice *metoken.QueryIndexPrices `json:"metoken_indexprice,omitempty"` + IndexPrices *metoken.QueryIndexPrices `json:"metoken_indexprices,omitempty"` } // MarshalResponse marshals any response. diff --git a/app/wasm/test/umee_cw_test.go b/app/wasm/test/umee_cw_test.go index dcc8c6b3b3..f319bd108a 100644 --- a/app/wasm/test/umee_cw_test.go +++ b/app/wasm/test/umee_cw_test.go @@ -199,27 +199,26 @@ func (s *IntegrationTestSuite) TestStargateQueries() { assert.DeepEqual(s.T, lvtypes.DefaultParams(), rr.Params) }, }, - // TODO: enable this once metoken is stable - // { - // name: "stargate: metoken queries ", - // sq: func() StargateQuery { - // data := metoken.QueryParams{} - // d, err := data.Marshal() - // assert.NilError(s.T, err) - // sq := StargateQuery{} - // sq.Chain.Stargate = wasmvmtypes.StargateQuery{ - // Path: "/umee.metoken.v1.Query/Params", - // Data: d, - // } - // return sq - // }, - // resp: func(resp wasmtypes.QuerySmartContractStateResponse) { - // var rr metoken.QueryParamsResponse - // err := s.encfg.Codec.UnmarshalJSON(resp.Data, &rr) - // assert.NilError(s.T, err) - // assert.DeepEqual(s.T, metoken.DefaultParams(), rr.Params) - // }, - // }, + { + name: "stargate: metoken queries ", + sq: func() StargateQuery { + data := metoken.QueryParams{} + d, err := data.Marshal() + assert.NilError(s.T, err) + sq := StargateQuery{} + sq.Chain.Stargate = wasmvmtypes.StargateQuery{ + Path: "/umee.metoken.v1.Query/Params", + Data: d, + } + return sq + }, + resp: func(resp wasmtypes.QuerySmartContractStateResponse) { + var rr metoken.QueryParamsResponse + err := s.encfg.Codec.UnmarshalJSON(resp.Data, &rr) + assert.NilError(s.T, err) + assert.DeepEqual(s.T, metoken.DefaultParams(), rr.Params) + }, + }, { name: "stargate: leverage market summary", sq: func() StargateQuery {