From a33f64a909e616bf3cd5a5a5ad4428fafd5bc1c3 Mon Sep 17 00:00:00 2001 From: rbajollari Date: Tue, 6 Dec 2022 15:21:10 -0500 Subject: [PATCH 1/9] Add median stats grpc queries --- proto/umee/oracle/v1/query.proto | 114 ++ x/oracle/keeper/grpc_query.go | 110 +- x/oracle/keeper/grpc_query_test.go | 90 +- x/oracle/types/query.pb.go | 2366 +++++++++++++++++++++++----- x/oracle/types/query.pb.gw.go | 332 ++++ 5 files changed, 2637 insertions(+), 375 deletions(-) diff --git a/proto/umee/oracle/v1/query.proto b/proto/umee/oracle/v1/query.proto index 13ecf91fc3..68b24b5aa1 100644 --- a/proto/umee/oracle/v1/query.proto +++ b/proto/umee/oracle/v1/query.proto @@ -93,6 +93,38 @@ service Query { option (google.api.http).get = "/umee/historacle/v1/denoms/median_deviations"; } + + // MedianOfMedians returns the median of a specified amount of + // stamped medians + rpc MedianOfMedians(QueryMedianOfMedians) + returns (QueryMedianOfMediansResponse) { + option (google.api.http).get = + "/umee/historacle/v1/denoms/median_of_medians"; + } + + // AverageOfMedians returns the average of a specified amount of + // stamped medians + rpc AverageOfMedians(QueryAverageOfMedians) + returns (QueryAverageOfMediansResponse) { + option (google.api.http).get = + "/umee/historacle/v1/denoms/average_of_medians"; + } + + // MinOfMedians returns the min of a specified amount of + // stamped medians + rpc MinOfMedians(QueryMinOfMedians) + returns (QueryMinOfMediansResponse) { + option (google.api.http).get = + "/umee/historacle/v1/denoms/min_of_medians"; + } + + // MaxOfMedians returns the max of a specified amount of + // stamped medians + rpc MaxOfMedians(QueryMaxOfMedians) + returns (QueryMaxOfMediansResponse) { + option (google.api.http).get = + "/umee/historacle/v1/denoms/max_of_medians"; + } } // QueryExchangeRates is the request type for the Query/ExchangeRate RPC @@ -252,6 +284,8 @@ message QueryMedians { option (gogoproto.goproto_getters) = false; // denom defines the denomination to query for. string denom = 1; + // numStamps defines the number of median stamps to query for. + uint64 numStamps = 2; } // QueryMediansResponse is response type for the @@ -281,3 +315,83 @@ message QueryMedianDeviationsResponse { (gogoproto.nullable) = false ]; } + +// QueryMedianOfMedians is the request type for the Query/MedianOfMedians RPC Response. +message QueryMedianOfMedians { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // denom defines the denomination to query for. + string denom = 1; + // numStamps defines the number of median stamps to query for. + uint64 numStamps = 2; +} + +// QueryMedianOfMediansResponse is response type for the +// Query/MedianOfMediansResponse RPC method. +message QueryMedianOfMediansResponse { + // medianOfMedian defines a median of stamped medians. + cosmos.base.v1beta1.DecCoin medianOfMedians = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoin", + (gogoproto.nullable) = false + ]; +} + +// QueryAverageOfMedians is the request type for the Query/AverageOfMedians RPC Response. +message QueryAverageOfMedians { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // denom defines the denomination to query for. + string denom = 1; + // numStamps defines the number of median stamps to query for. + uint64 numStamps = 2; +} + +// QueryAverageOfMediansResponse is response type for the +// Query/AverageOfMediansResponse RPC method. +message QueryAverageOfMediansResponse { + // averageOfMedian defines a average of stamped medians. + cosmos.base.v1beta1.DecCoin averageOfMedians = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoin", + (gogoproto.nullable) = false + ]; +} + +// QueryMinOfMedians is the request type for the Query/MinOfMedians RPC Response. +message QueryMinOfMedians { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // denom defines the denomination to query for. + string denom = 1; + // numStamps defines the number of median stamps to query for. + uint64 numStamps = 2; +} + +// QueryMinOfMediansResponse is response type for the +// Query/MinOfMediansResponse RPC method. +message QueryMinOfMediansResponse { + // minOfMedian defines a min of stamped medians. + cosmos.base.v1beta1.DecCoin minOfMedians = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoin", + (gogoproto.nullable) = false + ]; +} + +// QueryMaxOfMedians is the request type for the Query/MaxOfMedians RPC Response. +message QueryMaxOfMedians { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // denom defines the denomination to query for. + string denom = 1; + // numStamps defines the number of median stamps to query for. + uint64 numStamps = 2; +} + +// QueryMaxOfMediansResponse is response type for the +// Query/MaxOfMediansResponse RPC method. +message QueryMaxOfMediansResponse { + // maxOfMedian defines a max of stamped medians. + cosmos.base.v1beta1.DecCoin maxOfMedians = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoin", + (gogoproto.nullable) = false + ]; +} diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 876323805a..f1e70fd51f 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -265,15 +265,14 @@ func (q querier) Medians( var medians sdk.DecCoins if len(req.Denom) > 0 { - exchangeRate, err := q.GetMedian(ctx, req.Denom) - if err != nil { - return nil, err - } + medianList := q.GetHistoricMedians(ctx, req.Denom, req.NumStamps) - medians = medians.Add(sdk.NewDecCoinFromDec(req.Denom, exchangeRate)) + for _, median := range medianList { + medians = medians.Add(sdk.NewDecCoinFromDec(req.Denom, median)) + } } else { - q.IterateAllMedianPrices(ctx, func(exchangeRateTuple types.ExchangeRateTuple) (stop bool) { - medians = medians.Add(sdk.NewDecCoinFromDec(exchangeRateTuple.Denom, exchangeRateTuple.ExchangeRate)) + q.IterateAllMedianPrices(ctx, func(median types.HistoricPrice) (stop bool) { + medians = medians.Add(sdk.NewDecCoinFromDec(median.ExchangeRateTuple.Denom, median.ExchangeRateTuple.ExchangeRate)) return false }) } @@ -296,18 +295,109 @@ func (q querier) MedianDeviations( var medians sdk.DecCoins if len(req.Denom) > 0 { - exchangeRate, err := q.GetMedianDeviation(ctx, req.Denom) + exchangeRate, err := q.GetHistoricMedianDeviation(ctx, req.Denom) if err != nil { return nil, err } medians = medians.Add(sdk.NewDecCoinFromDec(req.Denom, exchangeRate)) } else { - q.IterateAllMedianDeviationPrices(ctx, func(exchangeRateTuple types.ExchangeRateTuple) (stop bool) { - medians = medians.Add(sdk.NewDecCoinFromDec(exchangeRateTuple.Denom, exchangeRateTuple.ExchangeRate)) + q.IterateAllMedianDeviationPrices(ctx, func(medianDeviation types.HistoricPrice) (stop bool) { + medians = medians.Add(sdk.NewDecCoinFromDec( + medianDeviation.ExchangeRateTuple.Denom, + medianDeviation.ExchangeRateTuple.ExchangeRate, + )) return false }) } return &types.QueryMedianDeviationsResponse{MedianDeviations: medians}, nil } + +// MedianOfMedians queries the median of a specified amount of stamped medians of +// a denom +func (q querier) MedianOfMedians( + goCtx context.Context, + req *types.QueryMedianOfMedians, +) (*types.QueryMedianOfMediansResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + medianOfMedians, err := q.GetMedianOfMedians(ctx, req.Denom, req.NumStamps) + if err != nil { + return nil, err + } + + medianResp := sdk.NewDecCoinFromDec(req.Denom, medianOfMedians) + + return &types.QueryMedianOfMediansResponse{MedianOfMedians: medianResp}, nil +} + +// AverageOfMedians queries the average of a specified amount of stamped medians of +// a denom +func (q querier) AverageOfMedians( + goCtx context.Context, + req *types.QueryAverageOfMedians, +) (*types.QueryAverageOfMediansResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + averageOfMedians, err := q.GetAverageOfMedians(ctx, req.Denom, req.NumStamps) + if err != nil { + return nil, err + } + + averageResp := sdk.NewDecCoinFromDec(req.Denom, averageOfMedians) + + return &types.QueryAverageOfMediansResponse{AverageOfMedians: averageResp}, nil +} + +// MinOfMedians queries the min of a specified amount of stamped medians of +// a denom +func (q querier) MinOfMedians( + goCtx context.Context, + req *types.QueryMinOfMedians, +) (*types.QueryMinOfMediansResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + minOfMedians, err := q.GetMinOfMedians(ctx, req.Denom, req.NumStamps) + if err != nil { + return nil, err + } + + minResp := sdk.NewDecCoinFromDec(req.Denom, minOfMedians) + + return &types.QueryMinOfMediansResponse{MinOfMedians: minResp}, nil +} + +// MaxOfMedians queries the max of a specified amount of stamped medians of +// a denom +func (q querier) MaxOfMedians( + goCtx context.Context, + req *types.QueryMaxOfMedians, +) (*types.QueryMaxOfMediansResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + maxOfMedians, err := q.GetMaxOfMedians(ctx, req.Denom, req.NumStamps) + if err != nil { + return nil, err + } + + maxResp := sdk.NewDecCoinFromDec(req.Denom, maxOfMedians) + + return &types.QueryMaxOfMediansResponse{MaxOfMedians: maxResp}, nil +} diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go index 50d86f081a..5e1867420a 100644 --- a/x/oracle/keeper/grpc_query_test.go +++ b/x/oracle/keeper/grpc_query_test.go @@ -203,37 +203,111 @@ func (s *IntegrationTestSuite) TestQuerier_AggregateVotesAppendVotes() { } func (s *IntegrationTestSuite) TestQuerier_Medians() { + app, ctx := s.app, s.ctx + atomMedian := sdk.DecCoin{Denom: "atom", Amount: sdk.MustNewDecFromStr("49.99")} umeeMedian := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} - s.app.OracleKeeper.SetMedian(s.ctx, atomMedian.Denom, atomMedian.Amount) - s.app.OracleKeeper.SetMedian(s.ctx, umeeMedian.Denom, umeeMedian.Amount) + app.OracleKeeper.SetMedianStampPeriod(ctx, 1) + app.OracleKeeper.SetMedian(ctx, atomMedian.Denom, uint64(ctx.BlockHeight()-1), atomMedian.Amount) + app.OracleKeeper.SetMedian(ctx, umeeMedian.Denom, uint64(ctx.BlockHeight()-1), umeeMedian.Amount) - res, err := s.queryClient.Medians(s.ctx.Context(), &types.QueryMedians{}) + res, err := s.queryClient.Medians(ctx.Context(), &types.QueryMedians{}) s.Require().NoError(err) s.Require().Equal(res.Medians, sdk.NewDecCoins(atomMedian, umeeMedian)) - res, err = s.queryClient.Medians(s.ctx.Context(), &types.QueryMedians{Denom: atomMedian.Denom}) + res, err = s.queryClient.Medians(ctx.Context(), &types.QueryMedians{Denom: atomMedian.Denom, NumStamps: 1}) s.Require().NoError(err) s.Require().Equal(res.Medians, sdk.NewDecCoins(atomMedian)) } func (s *IntegrationTestSuite) TestQuerier_MedianDeviations() { + app, ctx := s.app, s.ctx + atomMedianDeviation := sdk.DecCoin{Denom: "atom", Amount: sdk.MustNewDecFromStr("39.99")} umeeMedianDeviation := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("9541.48")} - s.app.OracleKeeper.SetMedianDeviation(s.ctx, atomMedianDeviation.Denom, atomMedianDeviation.Amount) - s.app.OracleKeeper.SetMedianDeviation(s.ctx, umeeMedianDeviation.Denom, umeeMedianDeviation.Amount) + app.OracleKeeper.SetMedianStampPeriod(ctx, 1) + app.OracleKeeper.SetMedianDeviation(ctx, atomMedianDeviation.Denom, uint64(ctx.BlockHeight()-1), atomMedianDeviation.Amount) + app.OracleKeeper.SetMedianDeviation(ctx, umeeMedianDeviation.Denom, uint64(ctx.BlockHeight()-1), umeeMedianDeviation.Amount) - res, err := s.queryClient.MedianDeviations(s.ctx.Context(), &types.QueryMedianDeviations{}) + res, err := s.queryClient.MedianDeviations(ctx.Context(), &types.QueryMedianDeviations{}) s.Require().NoError(err) s.Require().Equal(res.MedianDeviations, sdk.NewDecCoins(atomMedianDeviation, umeeMedianDeviation)) - res, err = s.queryClient.MedianDeviations(s.ctx.Context(), &types.QueryMedianDeviations{Denom: atomMedianDeviation.Denom}) + res, err = s.queryClient.MedianDeviations(ctx.Context(), &types.QueryMedianDeviations{Denom: atomMedianDeviation.Denom}) s.Require().NoError(err) s.Require().Equal(res.MedianDeviations, sdk.NewDecCoins(atomMedianDeviation)) } +func (s *IntegrationTestSuite) TestQuerier_MedianOfMedians() { + app, ctx := s.app, s.ctx + + umeeMedian1 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6523.38")} + umeeMedian2 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} + umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} + + app.OracleKeeper.SetMedianStampPeriod(ctx, 1) + app.OracleKeeper.SetMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) + app.OracleKeeper.SetMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) + app.OracleKeeper.SetMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) + + res, err := s.queryClient.MedianOfMedians(ctx.Context(), &types.QueryMedianOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) + s.Require().NoError(err) + s.Require().Equal(res.MedianOfMedians, umeeMedian3) +} + +func (s *IntegrationTestSuite) TestQuerier_AverageOfMedians() { + app, ctx := s.app, s.ctx + + umeeMedian1 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6523.38")} + umeeMedian2 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} + umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} + + app.OracleKeeper.SetMedianStampPeriod(ctx, 1) + app.OracleKeeper.SetMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) + app.OracleKeeper.SetMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) + app.OracleKeeper.SetMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) + + res, err := s.queryClient.AverageOfMedians(ctx.Context(), &types.QueryAverageOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) + s.Require().NoError(err) + s.Require().Equal(res.AverageOfMedians, sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.593333333333333333")}) +} + +func (s *IntegrationTestSuite) TestQuerier_MinOfMedians() { + app, ctx := s.app, s.ctx + + umeeMedian1 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6523.38")} + umeeMedian2 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} + umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} + + app.OracleKeeper.SetMedianStampPeriod(ctx, 1) + app.OracleKeeper.SetMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) + app.OracleKeeper.SetMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) + app.OracleKeeper.SetMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) + + res, err := s.queryClient.MinOfMedians(ctx.Context(), &types.QueryMinOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) + s.Require().NoError(err) + s.Require().Equal(res.MinOfMedians, umeeMedian1) +} + +func (s *IntegrationTestSuite) TestQuerier_MaxOfMedians() { + app, ctx := s.app, s.ctx + + umeeMedian1 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6523.38")} + umeeMedian2 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} + umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} + + app.OracleKeeper.SetMedianStampPeriod(ctx, 1) + app.OracleKeeper.SetMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) + app.OracleKeeper.SetMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) + app.OracleKeeper.SetMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) + + res, err := s.queryClient.MaxOfMedians(ctx.Context(), &types.QueryMaxOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) + s.Require().NoError(err) + s.Require().Equal(res.MaxOfMedians, umeeMedian2) +} + func (s *IntegrationTestSuite) TestEmptyRequest() { q := keeper.NewQuerier(keeper.Keeper{}) const emptyRequestErrorMsg = "empty request" diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 17539f6080..523bab9d52 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -830,6 +830,8 @@ var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo type QueryMedians struct { // denom defines the denomination to query for. Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // numStamps defines the number of median stamps to query for. + NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` } func (m *QueryMedians) Reset() { *m = QueryMedians{} } @@ -905,7 +907,7 @@ func (m *QueryMediansResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMediansResponse proto.InternalMessageInfo -// QueryMedians is the request type for the Query/Medians RPC Response. +// QueryMedianDeviations is the request type for the Query/MedianDeviations RPC Response. type QueryMedianDeviations struct { // denom defines the denomination to query for. Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` @@ -944,10 +946,10 @@ func (m *QueryMedianDeviations) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMedianDeviations proto.InternalMessageInfo -// QueryMediansResponse is response type for the -// Query/Medians RPC method. +// QueryMedianDeviationsResponse is response type for the +// Query/MedianDeviations RPC method. type QueryMedianDeviationsResponse struct { - // medians defines a list of the medians for all stamped denoms. + // medians defines a list of the median deviations for all stamped denoms. MedianDeviations github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=medianDeviations,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"medianDeviations"` } @@ -984,6 +986,330 @@ func (m *QueryMedianDeviationsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMedianDeviationsResponse proto.InternalMessageInfo +// QueryMedianOfMedians is the request type for the Query/MedianOfMedians RPC Response. +type QueryMedianOfMedians struct { + // denom defines the denomination to query for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // numStamps defines the number of median stamps to query for. + NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` +} + +func (m *QueryMedianOfMedians) Reset() { *m = QueryMedianOfMedians{} } +func (m *QueryMedianOfMedians) String() string { return proto.CompactTextString(m) } +func (*QueryMedianOfMedians) ProtoMessage() {} +func (*QueryMedianOfMedians) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{24} +} +func (m *QueryMedianOfMedians) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMedianOfMedians) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMedianOfMedians.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryMedianOfMedians) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMedianOfMedians.Merge(m, src) +} +func (m *QueryMedianOfMedians) XXX_Size() int { + return m.Size() +} +func (m *QueryMedianOfMedians) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMedianOfMedians.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMedianOfMedians proto.InternalMessageInfo + +// QueryMedianOfMediansResponse is response type for the +// Query/MedianOfMediansResponse RPC method. +type QueryMedianOfMediansResponse struct { + // medianOfMedian defines a median of stamped medians. + MedianOfMedians types.DecCoin `protobuf:"bytes,1,opt,name=medianOfMedians,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"medianOfMedians"` +} + +func (m *QueryMedianOfMediansResponse) Reset() { *m = QueryMedianOfMediansResponse{} } +func (m *QueryMedianOfMediansResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMedianOfMediansResponse) ProtoMessage() {} +func (*QueryMedianOfMediansResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{25} +} +func (m *QueryMedianOfMediansResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMedianOfMediansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMedianOfMediansResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryMedianOfMediansResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMedianOfMediansResponse.Merge(m, src) +} +func (m *QueryMedianOfMediansResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryMedianOfMediansResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMedianOfMediansResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMedianOfMediansResponse proto.InternalMessageInfo + +// QueryAverageOfMedians is the request type for the Query/AverageOfMedians RPC Response. +type QueryAverageOfMedians struct { + // denom defines the denomination to query for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // numStamps defines the number of median stamps to query for. + NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` +} + +func (m *QueryAverageOfMedians) Reset() { *m = QueryAverageOfMedians{} } +func (m *QueryAverageOfMedians) String() string { return proto.CompactTextString(m) } +func (*QueryAverageOfMedians) ProtoMessage() {} +func (*QueryAverageOfMedians) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{26} +} +func (m *QueryAverageOfMedians) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAverageOfMedians) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAverageOfMedians.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAverageOfMedians) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAverageOfMedians.Merge(m, src) +} +func (m *QueryAverageOfMedians) XXX_Size() int { + return m.Size() +} +func (m *QueryAverageOfMedians) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAverageOfMedians.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAverageOfMedians proto.InternalMessageInfo + +// QueryAverageOfMediansResponse is response type for the +// Query/AverageOfMediansResponse RPC method. +type QueryAverageOfMediansResponse struct { + // averageOfMedian defines a average of stamped medians. + AverageOfMedians types.DecCoin `protobuf:"bytes,1,opt,name=averageOfMedians,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"averageOfMedians"` +} + +func (m *QueryAverageOfMediansResponse) Reset() { *m = QueryAverageOfMediansResponse{} } +func (m *QueryAverageOfMediansResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAverageOfMediansResponse) ProtoMessage() {} +func (*QueryAverageOfMediansResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{27} +} +func (m *QueryAverageOfMediansResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAverageOfMediansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAverageOfMediansResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAverageOfMediansResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAverageOfMediansResponse.Merge(m, src) +} +func (m *QueryAverageOfMediansResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAverageOfMediansResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAverageOfMediansResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAverageOfMediansResponse proto.InternalMessageInfo + +// QueryMinOfMedians is the request type for the Query/MinOfMedians RPC Response. +type QueryMinOfMedians struct { + // denom defines the denomination to query for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // numStamps defines the number of median stamps to query for. + NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` +} + +func (m *QueryMinOfMedians) Reset() { *m = QueryMinOfMedians{} } +func (m *QueryMinOfMedians) String() string { return proto.CompactTextString(m) } +func (*QueryMinOfMedians) ProtoMessage() {} +func (*QueryMinOfMedians) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{28} +} +func (m *QueryMinOfMedians) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMinOfMedians) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMinOfMedians.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryMinOfMedians) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMinOfMedians.Merge(m, src) +} +func (m *QueryMinOfMedians) XXX_Size() int { + return m.Size() +} +func (m *QueryMinOfMedians) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMinOfMedians.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMinOfMedians proto.InternalMessageInfo + +// QueryMinOfMediansResponse is response type for the +// Query/MinOfMediansResponse RPC method. +type QueryMinOfMediansResponse struct { + // minOfMedian defines a min of stamped medians. + MinOfMedians types.DecCoin `protobuf:"bytes,1,opt,name=minOfMedians,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"minOfMedians"` +} + +func (m *QueryMinOfMediansResponse) Reset() { *m = QueryMinOfMediansResponse{} } +func (m *QueryMinOfMediansResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMinOfMediansResponse) ProtoMessage() {} +func (*QueryMinOfMediansResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{29} +} +func (m *QueryMinOfMediansResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMinOfMediansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMinOfMediansResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryMinOfMediansResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMinOfMediansResponse.Merge(m, src) +} +func (m *QueryMinOfMediansResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryMinOfMediansResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMinOfMediansResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMinOfMediansResponse proto.InternalMessageInfo + +// QueryMaxOfMedians is the request type for the Query/MaxOfMedians RPC Response. +type QueryMaxOfMedians struct { + // denom defines the denomination to query for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // numStamps defines the number of median stamps to query for. + NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` +} + +func (m *QueryMaxOfMedians) Reset() { *m = QueryMaxOfMedians{} } +func (m *QueryMaxOfMedians) String() string { return proto.CompactTextString(m) } +func (*QueryMaxOfMedians) ProtoMessage() {} +func (*QueryMaxOfMedians) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{30} +} +func (m *QueryMaxOfMedians) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMaxOfMedians) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMaxOfMedians.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryMaxOfMedians) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMaxOfMedians.Merge(m, src) +} +func (m *QueryMaxOfMedians) XXX_Size() int { + return m.Size() +} +func (m *QueryMaxOfMedians) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMaxOfMedians.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMaxOfMedians proto.InternalMessageInfo + +// QueryMaxOfMediansResponse is response type for the +// Query/MaxOfMediansResponse RPC method. +type QueryMaxOfMediansResponse struct { + // maxOfMedian defines a max of stamped medians. + MaxOfMedians types.DecCoin `protobuf:"bytes,1,opt,name=maxOfMedians,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"maxOfMedians"` +} + +func (m *QueryMaxOfMediansResponse) Reset() { *m = QueryMaxOfMediansResponse{} } +func (m *QueryMaxOfMediansResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMaxOfMediansResponse) ProtoMessage() {} +func (*QueryMaxOfMediansResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_710e319bc1815d33, []int{31} +} +func (m *QueryMaxOfMediansResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMaxOfMediansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMaxOfMediansResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryMaxOfMediansResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMaxOfMediansResponse.Merge(m, src) +} +func (m *QueryMaxOfMediansResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryMaxOfMediansResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMaxOfMediansResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMaxOfMediansResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*QueryExchangeRates)(nil), "umee.oracle.v1.QueryExchangeRates") proto.RegisterType((*QueryExchangeRatesResponse)(nil), "umee.oracle.v1.QueryExchangeRatesResponse") @@ -1009,83 +1335,106 @@ func init() { proto.RegisterType((*QueryMediansResponse)(nil), "umee.oracle.v1.QueryMediansResponse") proto.RegisterType((*QueryMedianDeviations)(nil), "umee.oracle.v1.QueryMedianDeviations") proto.RegisterType((*QueryMedianDeviationsResponse)(nil), "umee.oracle.v1.QueryMedianDeviationsResponse") + proto.RegisterType((*QueryMedianOfMedians)(nil), "umee.oracle.v1.QueryMedianOfMedians") + proto.RegisterType((*QueryMedianOfMediansResponse)(nil), "umee.oracle.v1.QueryMedianOfMediansResponse") + proto.RegisterType((*QueryAverageOfMedians)(nil), "umee.oracle.v1.QueryAverageOfMedians") + proto.RegisterType((*QueryAverageOfMediansResponse)(nil), "umee.oracle.v1.QueryAverageOfMediansResponse") + proto.RegisterType((*QueryMinOfMedians)(nil), "umee.oracle.v1.QueryMinOfMedians") + proto.RegisterType((*QueryMinOfMediansResponse)(nil), "umee.oracle.v1.QueryMinOfMediansResponse") + proto.RegisterType((*QueryMaxOfMedians)(nil), "umee.oracle.v1.QueryMaxOfMedians") + proto.RegisterType((*QueryMaxOfMediansResponse)(nil), "umee.oracle.v1.QueryMaxOfMediansResponse") } func init() { proto.RegisterFile("umee/oracle/v1/query.proto", fileDescriptor_710e319bc1815d33) } var fileDescriptor_710e319bc1815d33 = []byte{ - // 1129 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0xbd, 0xd0, 0x1f, 0xf4, 0xb9, 0x76, 0xdd, 0x69, 0x1b, 0x45, 0x9b, 0xb0, 0x09, 0xd3, - 0x14, 0x42, 0x9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, + 0xa9, 0x7e, 0x63, 0x73, 0xdc, 0x04, 0x91, 0xae, 0xee, 0x32, 0x88, 0xb4, 0x90, 0x2c, 0xa2, 0x14, + 0x3d, 0x37, 0x1c, 0x11, 0xd9, 0xd0, 0x88, 0x16, 0x2e, 0x3d, 0xfc, 0xbb, 0x9c, 0x7b, 0xf8, 0xb8, + 0x6c, 0x3c, 0x7a, 0x5c, 0x36, 0xfe, 0x7a, 0x5c, 0x36, 0xbe, 0x7a, 0x52, 0xce, 0x3d, 0x7a, 0x52, + 0xce, 0xfd, 0xfe, 0xa4, 0x9c, 0x7b, 0xdf, 0xd2, 0x44, 0x5e, 0x98, 0x72, 0xd6, 0xa5, 0xc1, 0xba, + 0xe7, 0xdf, 0x10, 0xf9, 0x3b, 0x67, 0xed, 0x8d, 0xee, 0x89, 0xe6, 0x82, 0x6f, 0x79, 0x2f, 0xff, + 0xc3, 0xe7, 0xd9, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x04, 0xa1, 0x84, 0x22, 0x97, 0x15, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1124,9 +1473,21 @@ type QueryClient interface { // Medians returns medians of all denoms, // or, if specified, returns a single median Medians(ctx context.Context, in *QueryMedians, opts ...grpc.CallOption) (*QueryMediansResponse, error) - // MedianDeviations returns medians of all denoms, - // or, if specified, returns a single median + // MedianDeviations returns median deviations of all denoms, + // or, if specified, returns a single median deviation MedianDeviations(ctx context.Context, in *QueryMedianDeviations, opts ...grpc.CallOption) (*QueryMedianDeviationsResponse, error) + // MedianOfMedians returns the median of a specified amount of + // stamped medians + MedianOfMedians(ctx context.Context, in *QueryMedianOfMedians, opts ...grpc.CallOption) (*QueryMedianOfMediansResponse, error) + // AverageOfMedians returns the average of a specified amount of + // stamped medians + AverageOfMedians(ctx context.Context, in *QueryAverageOfMedians, opts ...grpc.CallOption) (*QueryAverageOfMediansResponse, error) + // MinOfMedians returns the min of a specified amount of + // stamped medians + MinOfMedians(ctx context.Context, in *QueryMinOfMedians, opts ...grpc.CallOption) (*QueryMinOfMediansResponse, error) + // MaxOfMedians returns the max of a specified amount of + // stamped medians + MaxOfMedians(ctx context.Context, in *QueryMaxOfMedians, opts ...grpc.CallOption) (*QueryMaxOfMediansResponse, error) } type queryClient struct { @@ -1245,6 +1606,42 @@ func (c *queryClient) MedianDeviations(ctx context.Context, in *QueryMedianDevia return out, nil } +func (c *queryClient) MedianOfMedians(ctx context.Context, in *QueryMedianOfMedians, opts ...grpc.CallOption) (*QueryMedianOfMediansResponse, error) { + out := new(QueryMedianOfMediansResponse) + err := c.cc.Invoke(ctx, "/umee.oracle.v1.Query/MedianOfMedians", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AverageOfMedians(ctx context.Context, in *QueryAverageOfMedians, opts ...grpc.CallOption) (*QueryAverageOfMediansResponse, error) { + out := new(QueryAverageOfMediansResponse) + err := c.cc.Invoke(ctx, "/umee.oracle.v1.Query/AverageOfMedians", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MinOfMedians(ctx context.Context, in *QueryMinOfMedians, opts ...grpc.CallOption) (*QueryMinOfMediansResponse, error) { + out := new(QueryMinOfMediansResponse) + err := c.cc.Invoke(ctx, "/umee.oracle.v1.Query/MinOfMedians", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MaxOfMedians(ctx context.Context, in *QueryMaxOfMedians, opts ...grpc.CallOption) (*QueryMaxOfMediansResponse, error) { + out := new(QueryMaxOfMediansResponse) + err := c.cc.Invoke(ctx, "/umee.oracle.v1.Query/MaxOfMedians", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // ExchangeRates returns exchange rates of all denoms, @@ -1271,9 +1668,21 @@ type QueryServer interface { // Medians returns medians of all denoms, // or, if specified, returns a single median Medians(context.Context, *QueryMedians) (*QueryMediansResponse, error) - // MedianDeviations returns medians of all denoms, - // or, if specified, returns a single median + // MedianDeviations returns median deviations of all denoms, + // or, if specified, returns a single median deviation MedianDeviations(context.Context, *QueryMedianDeviations) (*QueryMedianDeviationsResponse, error) + // MedianOfMedians returns the median of a specified amount of + // stamped medians + MedianOfMedians(context.Context, *QueryMedianOfMedians) (*QueryMedianOfMediansResponse, error) + // AverageOfMedians returns the average of a specified amount of + // stamped medians + AverageOfMedians(context.Context, *QueryAverageOfMedians) (*QueryAverageOfMediansResponse, error) + // MinOfMedians returns the min of a specified amount of + // stamped medians + MinOfMedians(context.Context, *QueryMinOfMedians) (*QueryMinOfMediansResponse, error) + // MaxOfMedians returns the max of a specified amount of + // stamped medians + MaxOfMedians(context.Context, *QueryMaxOfMedians) (*QueryMaxOfMediansResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1316,6 +1725,18 @@ func (*UnimplementedQueryServer) Medians(ctx context.Context, req *QueryMedians) func (*UnimplementedQueryServer) MedianDeviations(ctx context.Context, req *QueryMedianDeviations) (*QueryMedianDeviationsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MedianDeviations not implemented") } +func (*UnimplementedQueryServer) MedianOfMedians(ctx context.Context, req *QueryMedianOfMedians) (*QueryMedianOfMediansResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MedianOfMedians not implemented") +} +func (*UnimplementedQueryServer) AverageOfMedians(ctx context.Context, req *QueryAverageOfMedians) (*QueryAverageOfMediansResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AverageOfMedians not implemented") +} +func (*UnimplementedQueryServer) MinOfMedians(ctx context.Context, req *QueryMinOfMedians) (*QueryMinOfMediansResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MinOfMedians not implemented") +} +func (*UnimplementedQueryServer) MaxOfMedians(ctx context.Context, req *QueryMaxOfMedians) (*QueryMaxOfMediansResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MaxOfMedians not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1537,58 +1958,146 @@ func _Query_MedianDeviations_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "umee.oracle.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ExchangeRates", - Handler: _Query_ExchangeRates_Handler, - }, - { - MethodName: "ActiveExchangeRates", - Handler: _Query_ActiveExchangeRates_Handler, - }, - { - MethodName: "FeederDelegation", - Handler: _Query_FeederDelegation_Handler, - }, - { - MethodName: "MissCounter", - Handler: _Query_MissCounter_Handler, - }, - { - MethodName: "SlashWindow", - Handler: _Query_SlashWindow_Handler, - }, - { - MethodName: "AggregatePrevote", - Handler: _Query_AggregatePrevote_Handler, - }, - { - MethodName: "AggregatePrevotes", - Handler: _Query_AggregatePrevotes_Handler, - }, - { - MethodName: "AggregateVote", - Handler: _Query_AggregateVote_Handler, - }, - { - MethodName: "AggregateVotes", - Handler: _Query_AggregateVotes_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Medians", +func _Query_MedianOfMedians_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMedianOfMedians) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MedianOfMedians(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.oracle.v1.Query/MedianOfMedians", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MedianOfMedians(ctx, req.(*QueryMedianOfMedians)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AverageOfMedians_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAverageOfMedians) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AverageOfMedians(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.oracle.v1.Query/AverageOfMedians", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AverageOfMedians(ctx, req.(*QueryAverageOfMedians)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MinOfMedians_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMinOfMedians) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MinOfMedians(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.oracle.v1.Query/MinOfMedians", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MinOfMedians(ctx, req.(*QueryMinOfMedians)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MaxOfMedians_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMaxOfMedians) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MaxOfMedians(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.oracle.v1.Query/MaxOfMedians", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MaxOfMedians(ctx, req.(*QueryMaxOfMedians)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "umee.oracle.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ExchangeRates", + Handler: _Query_ExchangeRates_Handler, + }, + { + MethodName: "ActiveExchangeRates", + Handler: _Query_ActiveExchangeRates_Handler, + }, + { + MethodName: "FeederDelegation", + Handler: _Query_FeederDelegation_Handler, + }, + { + MethodName: "MissCounter", + Handler: _Query_MissCounter_Handler, + }, + { + MethodName: "SlashWindow", + Handler: _Query_SlashWindow_Handler, + }, + { + MethodName: "AggregatePrevote", + Handler: _Query_AggregatePrevote_Handler, + }, + { + MethodName: "AggregatePrevotes", + Handler: _Query_AggregatePrevotes_Handler, + }, + { + MethodName: "AggregateVote", + Handler: _Query_AggregateVote_Handler, + }, + { + MethodName: "AggregateVotes", + Handler: _Query_AggregateVotes_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Medians", Handler: _Query_Medians_Handler, }, { MethodName: "MedianDeviations", Handler: _Query_MedianDeviations_Handler, }, + { + MethodName: "MedianOfMedians", + Handler: _Query_MedianOfMedians_Handler, + }, + { + MethodName: "AverageOfMedians", + Handler: _Query_AverageOfMedians_Handler, + }, + { + MethodName: "MinOfMedians", + Handler: _Query_MinOfMedians_Handler, + }, + { + MethodName: "MaxOfMedians", + Handler: _Query_MaxOfMedians_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "umee/oracle/v1/query.proto", @@ -2207,6 +2716,11 @@ func (m *QueryMedians) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.NumStamps != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NumStamps)) + i-- + dAtA[i] = 0x10 + } if len(m.Denom) > 0 { i -= len(m.Denom) copy(dAtA[i:], m.Denom) @@ -2321,118 +2835,390 @@ func (m *QueryMedianDeviationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryMedianOfMedians) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *QueryExchangeRates) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n + +func (m *QueryMedianOfMedians) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryExchangeRatesResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryMedianOfMedians) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.ExchangeRates) > 0 { - for _, e := range m.ExchangeRates { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } + if m.NumStamps != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NumStamps)) + i-- + dAtA[i] = 0x10 } - return n + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *QueryActiveExchangeRates) Size() (n int) { - if m == nil { - return 0 +func (m *QueryMedianOfMediansResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *QueryActiveExchangeRatesResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryMedianOfMediansResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMedianOfMediansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.ActiveRates) > 0 { - for _, s := range m.ActiveRates { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.MedianOfMedians.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryFeederDelegation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryAverageOfMedians) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *QueryFeederDelegationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FeederAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *QueryAverageOfMedians) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMissCounter) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryAverageOfMedians) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if m.NumStamps != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NumStamps)) + i-- + dAtA[i] = 0x10 } - return n + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *QueryMissCounterResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MissCounter != 0 { - n += 1 + sovQuery(uint64(m.MissCounter)) +func (m *QueryAverageOfMediansResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil +} + +func (m *QueryAverageOfMediansResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAverageOfMediansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AverageOfMedians.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryMinOfMedians) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryMinOfMedians) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMinOfMedians) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NumStamps != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NumStamps)) + i-- + dAtA[i] = 0x10 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMinOfMediansResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryMinOfMediansResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMinOfMediansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.MinOfMedians.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryMaxOfMedians) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryMaxOfMedians) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMaxOfMedians) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NumStamps != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NumStamps)) + i-- + dAtA[i] = 0x10 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMaxOfMediansResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryMaxOfMediansResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMaxOfMediansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.MaxOfMedians.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryExchangeRates) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryExchangeRatesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ExchangeRates) > 0 { + for _, e := range m.ExchangeRates { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryActiveExchangeRates) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryActiveExchangeRatesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ActiveRates) > 0 { + for _, s := range m.ActiveRates { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryFeederDelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFeederDelegationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FeederAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryMissCounter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryMissCounterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MissCounter != 0 { + n += 1 + sovQuery(uint64(m.MissCounter)) + } + return n } func (m *QuerySlashWindow) Size() (n int) { @@ -2582,6 +3368,9 @@ func (m *QueryMedians) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.NumStamps != 0 { + n += 1 + sovQuery(uint64(m.NumStamps)) + } return n } @@ -2628,11 +3417,119 @@ func (m *QueryMedianDeviationsResponse) Size() (n int) { return n } -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func (m *QueryMedianOfMedians) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.NumStamps != 0 { + n += 1 + sovQuery(uint64(m.NumStamps)) + } + return n +} + +func (m *QueryMedianOfMediansResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MedianOfMedians.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAverageOfMedians) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.NumStamps != 0 { + n += 1 + sovQuery(uint64(m.NumStamps)) + } + return n +} + +func (m *QueryAverageOfMediansResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.AverageOfMedians.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryMinOfMedians) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.NumStamps != 0 { + n += 1 + sovQuery(uint64(m.NumStamps)) + } + return n +} + +func (m *QueryMinOfMediansResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MinOfMedians.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryMaxOfMedians) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.NumStamps != 0 { + n += 1 + sovQuery(uint64(m.NumStamps)) + } + return n +} + +func (m *QueryMaxOfMediansResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MaxOfMedians.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *QueryExchangeRates) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -2778,7 +3675,504 @@ func (m *QueryExchangeRatesResponse) Unmarshal(dAtA []byte) error { if err := m.ExchangeRates[len(m.ExchangeRates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - iNdEx = postIndex + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryActiveExchangeRates) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryActiveExchangeRates: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryActiveExchangeRates: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryActiveExchangeRatesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryActiveExchangeRatesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryActiveExchangeRatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveRates", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActiveRates = append(m.ActiveRates, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeederDelegation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeederDelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeederDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeederDelegationResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeederDelegationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeederDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeederAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeederAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryMissCounter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryMissCounter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMissCounter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryMissCounterResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryMissCounterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMissCounterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MissCounter", wireType) + } + m.MissCounter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MissCounter |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySlashWindow) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySlashWindow: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySlashWindow: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2800,7 +4194,7 @@ func (m *QueryExchangeRatesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryActiveExchangeRates) Unmarshal(dAtA []byte) error { +func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2823,12 +4217,31 @@ func (m *QueryActiveExchangeRates) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryActiveExchangeRates: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySlashWindowResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryActiveExchangeRates: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySlashWindowResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WindowProgress", wireType) + } + m.WindowProgress = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.WindowProgress |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2850,7 +4263,7 @@ func (m *QueryActiveExchangeRates) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryActiveExchangeRatesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAggregatePrevote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2873,15 +4286,15 @@ func (m *QueryActiveExchangeRatesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryActiveExchangeRatesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregatePrevote: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryActiveExchangeRatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregatePrevote: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActiveRates", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2909,7 +4322,7 @@ func (m *QueryActiveExchangeRatesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ActiveRates = append(m.ActiveRates, string(dAtA[iNdEx:postIndex])) + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2932,7 +4345,7 @@ func (m *QueryActiveExchangeRatesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryFeederDelegation) Unmarshal(dAtA []byte) error { +func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2955,17 +4368,17 @@ func (m *QueryFeederDelegation) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryFeederDelegation: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregatePrevoteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryFeederDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregatePrevoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggregatePrevote", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2975,23 +4388,24 @@ func (m *QueryFeederDelegation) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + if err := m.AggregatePrevote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -3014,7 +4428,7 @@ func (m *QueryFeederDelegation) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryFeederDelegationResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAggregatePrevotes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3037,17 +4451,67 @@ func (m *QueryFeederDelegationResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryFeederDelegationResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregatePrevotes: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryFeederDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregatePrevotes: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAggregatePrevotesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAggregatePrevotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeederAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggregatePrevotes", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3057,23 +4521,25 @@ func (m *QueryFeederDelegationResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.FeederAddr = string(dAtA[iNdEx:postIndex]) + m.AggregatePrevotes = append(m.AggregatePrevotes, AggregateExchangeRatePrevote{}) + if err := m.AggregatePrevotes[len(m.AggregatePrevotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -3096,7 +4562,7 @@ func (m *QueryFeederDelegationResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMissCounter) Unmarshal(dAtA []byte) error { +func (m *QueryAggregateVote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3119,10 +4585,10 @@ func (m *QueryMissCounter) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMissCounter: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregateVote: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMissCounter: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregateVote: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3178,7 +4644,7 @@ func (m *QueryMissCounter) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMissCounterResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3201,17 +4667,17 @@ func (m *QueryMissCounterResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMissCounterResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregateVoteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMissCounterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregateVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MissCounter", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregateVote", wireType) } - m.MissCounter = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3221,11 +4687,25 @@ func (m *QueryMissCounterResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MissCounter |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AggregateVote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -3247,7 +4727,7 @@ func (m *QueryMissCounterResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySlashWindow) Unmarshal(dAtA []byte) error { +func (m *QueryAggregateVotes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3270,10 +4750,10 @@ func (m *QuerySlashWindow) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySlashWindow: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregateVotes: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySlashWindow: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregateVotes: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3297,7 +4777,7 @@ func (m *QuerySlashWindow) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3320,17 +4800,17 @@ func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySlashWindowResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregateVotesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySlashWindowResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregateVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WindowProgress", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregateVotes", wireType) } - m.WindowProgress = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3340,11 +4820,26 @@ func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WindowProgress |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AggregateVotes = append(m.AggregateVotes, AggregateExchangeRateVote{}) + if err := m.AggregateVotes[len(m.AggregateVotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -3366,7 +4861,7 @@ func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregatePrevote) Unmarshal(dAtA []byte) error { +func (m *QueryParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3389,44 +4884,12 @@ func (m *QueryAggregatePrevote) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregatePrevote: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregatePrevote: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -3448,7 +4911,7 @@ func (m *QueryAggregatePrevote) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3471,15 +4934,15 @@ func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregatePrevoteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregatePrevoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregatePrevote", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3506,7 +4969,7 @@ func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AggregatePrevote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3531,7 +4994,7 @@ func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregatePrevotes) Unmarshal(dAtA []byte) error { +func (m *QueryMedians) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3554,12 +5017,63 @@ func (m *QueryAggregatePrevotes) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregatePrevotes: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMedians: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregatePrevotes: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMedians: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumStamps", wireType) + } + m.NumStamps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumStamps |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -3581,7 +5095,7 @@ func (m *QueryAggregatePrevotes) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3604,15 +5118,15 @@ func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregatePrevotesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMediansResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregatePrevotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregatePrevotes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Medians", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3639,8 +5153,8 @@ func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AggregatePrevotes = append(m.AggregatePrevotes, AggregateExchangeRatePrevote{}) - if err := m.AggregatePrevotes[len(m.AggregatePrevotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Medians = append(m.Medians, types.DecCoin{}) + if err := m.Medians[len(m.Medians)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3665,7 +5179,7 @@ func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregateVote) Unmarshal(dAtA []byte) error { +func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3688,15 +5202,15 @@ func (m *QueryAggregateVote) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregateVote: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMedianDeviations: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregateVote: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMedianDeviations: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3724,7 +5238,7 @@ func (m *QueryAggregateVote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3747,7 +5261,7 @@ func (m *QueryAggregateVote) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMedianDeviationsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3770,15 +5284,15 @@ func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregateVoteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMedianDeviationsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregateVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMedianDeviationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateVote", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MedianDeviations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3805,7 +5319,8 @@ func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AggregateVote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.MedianDeviations = append(m.MedianDeviations, types.DecCoin{}) + if err := m.MedianDeviations[len(m.MedianDeviations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3830,7 +5345,7 @@ func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregateVotes) Unmarshal(dAtA []byte) error { +func (m *QueryMedianOfMedians) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3853,12 +5368,63 @@ func (m *QueryAggregateVotes) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregateVotes: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMedianOfMedians: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregateVotes: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMedianOfMedians: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumStamps", wireType) + } + m.NumStamps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumStamps |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -3880,7 +5446,7 @@ func (m *QueryAggregateVotes) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMedianOfMediansResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3903,15 +5469,15 @@ func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregateVotesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMedianOfMediansResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregateVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMedianOfMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateVotes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MedianOfMedians", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3938,8 +5504,7 @@ func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AggregateVotes = append(m.AggregateVotes, AggregateExchangeRateVote{}) - if err := m.AggregateVotes[len(m.AggregateVotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.MedianOfMedians.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3964,7 +5529,7 @@ func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParams) Unmarshal(dAtA []byte) error { +func (m *QueryAverageOfMedians) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3987,12 +5552,63 @@ func (m *QueryParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParams: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAverageOfMedians: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAverageOfMedians: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumStamps", wireType) + } + m.NumStamps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumStamps |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4014,7 +5630,7 @@ func (m *QueryParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAverageOfMediansResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4037,15 +5653,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAverageOfMediansResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAverageOfMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AverageOfMedians", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4072,7 +5688,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AverageOfMedians.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4097,7 +5713,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMedians) Unmarshal(dAtA []byte) error { +func (m *QueryMinOfMedians) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4120,10 +5736,10 @@ func (m *QueryMedians) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMedians: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMinOfMedians: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMedians: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMinOfMedians: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4158,6 +5774,25 @@ func (m *QueryMedians) Unmarshal(dAtA []byte) error { } m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumStamps", wireType) + } + m.NumStamps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumStamps |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4179,7 +5814,7 @@ func (m *QueryMedians) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMinOfMediansResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4202,15 +5837,15 @@ func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMediansResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMinOfMediansResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMinOfMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Medians", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MinOfMedians", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4237,8 +5872,7 @@ func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Medians = append(m.Medians, types.DecCoin{}) - if err := m.Medians[len(m.Medians)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.MinOfMedians.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4263,7 +5897,7 @@ func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { +func (m *QueryMaxOfMedians) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4286,10 +5920,10 @@ func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMedianDeviations: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMaxOfMedians: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMedianDeviations: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMaxOfMedians: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4324,6 +5958,25 @@ func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { } m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumStamps", wireType) + } + m.NumStamps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumStamps |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4345,7 +5998,7 @@ func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMedianDeviationsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMaxOfMediansResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4368,15 +6021,15 @@ func (m *QueryMedianDeviationsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMedianDeviationsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMaxOfMediansResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMedianDeviationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMaxOfMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MedianDeviations", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxOfMedians", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4403,8 +6056,7 @@ func (m *QueryMedianDeviationsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MedianDeviations = append(m.MedianDeviations, types.DecCoin{}) - if err := m.MedianDeviations[len(m.MedianDeviations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.MaxOfMedians.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 761f396b21..bec4387b8c 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -465,6 +465,150 @@ func local_request_Query_MedianDeviations_0(ctx context.Context, marshaler runti } +var ( + filter_Query_MedianOfMedians_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_MedianOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMedianOfMedians + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MedianOfMedians_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MedianOfMedians(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MedianOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMedianOfMedians + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MedianOfMedians_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MedianOfMedians(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AverageOfMedians_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AverageOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAverageOfMedians + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AverageOfMedians_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AverageOfMedians(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AverageOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAverageOfMedians + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AverageOfMedians_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AverageOfMedians(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_MinOfMedians_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_MinOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMinOfMedians + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MinOfMedians_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MinOfMedians(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MinOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMinOfMedians + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MinOfMedians_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MinOfMedians(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_MaxOfMedians_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_MaxOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMaxOfMedians + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MaxOfMedians_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MaxOfMedians(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MaxOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMaxOfMedians + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MaxOfMedians_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MaxOfMedians(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -747,6 +891,98 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_MedianOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_MedianOfMedians_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_MedianOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AverageOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AverageOfMedians_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AverageOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MinOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_MinOfMedians_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_MinOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MaxOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_MaxOfMedians_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_MaxOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1028,6 +1264,86 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_MedianOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_MedianOfMedians_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_MedianOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AverageOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AverageOfMedians_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AverageOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MinOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_MinOfMedians_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_MinOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MaxOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_MaxOfMedians_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_MaxOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1055,6 +1371,14 @@ var ( pattern_Query_Medians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "medians"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_MedianDeviations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "median_deviations"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_MedianOfMedians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "median_of_medians"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AverageOfMedians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "average_of_medians"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_MinOfMedians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "min_of_medians"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_MaxOfMedians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "max_of_medians"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1081,4 +1405,12 @@ var ( forward_Query_Medians_0 = runtime.ForwardResponseMessage forward_Query_MedianDeviations_0 = runtime.ForwardResponseMessage + + forward_Query_MedianOfMedians_0 = runtime.ForwardResponseMessage + + forward_Query_AverageOfMedians_0 = runtime.ForwardResponseMessage + + forward_Query_MinOfMedians_0 = runtime.ForwardResponseMessage + + forward_Query_MaxOfMedians_0 = runtime.ForwardResponseMessage ) From 097dc63f6fec602542297b294950a295a7bb5f68 Mon Sep 17 00:00:00 2001 From: rbajollari Date: Thu, 8 Dec 2022 19:19:11 -0500 Subject: [PATCH 2/9] Fix query methods --- x/oracle/keeper/grpc_query.go | 16 ++++++++-------- x/oracle/keeper/grpc_query_test.go | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 8374b8ee0c..c638c7e63e 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -265,13 +265,13 @@ func (q querier) Medians( var medians sdk.DecCoins if len(req.Denom) > 0 { - medianList := q.GetHistoricMedians(ctx, req.Denom, req.NumStamps) + medianList := q.HistoricMedians(ctx, req.Denom, req.NumStamps) for _, median := range medianList { medians = medians.Add(sdk.NewDecCoinFromDec(req.Denom, median)) } } else { - q.IterateAllMedianPrices(ctx, func(median types.HistoricPrice) (stop bool) { + q.IterateAllMedianPrices(ctx, func(median types.Price) (stop bool) { medians = medians.Add(sdk.NewDecCoinFromDec(median.ExchangeRateTuple.Denom, median.ExchangeRateTuple.ExchangeRate)) return false }) @@ -295,7 +295,7 @@ func (q querier) MedianDeviations( var medians sdk.DecCoins if len(req.Denom) > 0 { - exchangeRate, err := q.GetHistoricMedianDeviation(ctx, req.Denom) + exchangeRate, err := q.HistoricMedianDeviation(ctx, req.Denom) if err != nil { return nil, err @@ -303,7 +303,7 @@ func (q querier) MedianDeviations( medians = medians.Add(sdk.NewDecCoinFromDec(req.Denom, exchangeRate)) } else { - q.IterateAllMedianDeviationPrices(ctx, func(medianDeviation types.HistoricPrice) (stop bool) { + q.IterateAllMedianDeviationPrices(ctx, func(medianDeviation types.Price) (stop bool) { medians = medians.Add(sdk.NewDecCoinFromDec( medianDeviation.ExchangeRateTuple.Denom, medianDeviation.ExchangeRateTuple.ExchangeRate, @@ -327,7 +327,7 @@ func (q querier) MedianOfMedians( ctx := sdk.UnwrapSDKContext(goCtx) - medianOfMedians, err := q.GetMedianOfMedians(ctx, req.Denom, req.NumStamps) + medianOfMedians, err := q.MedianOfHistoricMedians(ctx, req.Denom, req.NumStamps) if err != nil { return nil, err } @@ -349,7 +349,7 @@ func (q querier) AverageOfMedians( ctx := sdk.UnwrapSDKContext(goCtx) - averageOfMedians, err := q.GetAverageOfMedians(ctx, req.Denom, req.NumStamps) + averageOfMedians, err := q.AverageOfHistoricMedians(ctx, req.Denom, req.NumStamps) if err != nil { return nil, err } @@ -371,7 +371,7 @@ func (q querier) MinOfMedians( ctx := sdk.UnwrapSDKContext(goCtx) - minOfMedians, err := q.GetMinOfMedians(ctx, req.Denom, req.NumStamps) + minOfMedians, err := q.MinOfHistoricMedians(ctx, req.Denom, req.NumStamps) if err != nil { return nil, err } @@ -393,7 +393,7 @@ func (q querier) MaxOfMedians( ctx := sdk.UnwrapSDKContext(goCtx) - maxOfMedians, err := q.GetMaxOfMedians(ctx, req.Denom, req.NumStamps) + maxOfMedians, err := q.MaxOfHistoricMedians(ctx, req.Denom, req.NumStamps) if err != nil { return nil, err } diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go index e27ef15d33..4ab0da4b42 100644 --- a/x/oracle/keeper/grpc_query_test.go +++ b/x/oracle/keeper/grpc_query_test.go @@ -249,9 +249,9 @@ func (s *IntegrationTestSuite) TestQuerier_MedianOfMedians() { umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} app.OracleKeeper.SetMedianStampPeriod(ctx, 1) - app.OracleKeeper.SetMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) - app.OracleKeeper.SetMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) - app.OracleKeeper.SetMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) res, err := s.queryClient.MedianOfMedians(ctx.Context(), &types.QueryMedianOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) s.Require().NoError(err) @@ -266,9 +266,9 @@ func (s *IntegrationTestSuite) TestQuerier_AverageOfMedians() { umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} app.OracleKeeper.SetMedianStampPeriod(ctx, 1) - app.OracleKeeper.SetMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) - app.OracleKeeper.SetMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) - app.OracleKeeper.SetMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) res, err := s.queryClient.AverageOfMedians(ctx.Context(), &types.QueryAverageOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) s.Require().NoError(err) @@ -283,9 +283,9 @@ func (s *IntegrationTestSuite) TestQuerier_MinOfMedians() { umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} app.OracleKeeper.SetMedianStampPeriod(ctx, 1) - app.OracleKeeper.SetMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) - app.OracleKeeper.SetMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) - app.OracleKeeper.SetMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) res, err := s.queryClient.MinOfMedians(ctx.Context(), &types.QueryMinOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) s.Require().NoError(err) @@ -300,9 +300,9 @@ func (s *IntegrationTestSuite) TestQuerier_MaxOfMedians() { umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} app.OracleKeeper.SetMedianStampPeriod(ctx, 1) - app.OracleKeeper.SetMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) - app.OracleKeeper.SetMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) - app.OracleKeeper.SetMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) res, err := s.queryClient.MaxOfMedians(ctx.Context(), &types.QueryMaxOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) s.Require().NoError(err) From e1d847e747e0c604609f072c1c1c2ae98639b93c Mon Sep 17 00:00:00 2001 From: rbajollari Date: Fri, 9 Dec 2022 14:37:57 -0500 Subject: [PATCH 3/9] Remove uneeded queries --- proto/umee/oracle/v1/query.proto | 112 -- x/oracle/keeper/grpc_query.go | 88 - x/oracle/keeper/grpc_query_test.go | 68 - x/oracle/types/query.pb.go | 2394 +++++----------------------- x/oracle/types/query.pb.gw.go | 332 ---- 5 files changed, 386 insertions(+), 2608 deletions(-) diff --git a/proto/umee/oracle/v1/query.proto b/proto/umee/oracle/v1/query.proto index 68b24b5aa1..ac06a2964f 100644 --- a/proto/umee/oracle/v1/query.proto +++ b/proto/umee/oracle/v1/query.proto @@ -93,38 +93,6 @@ service Query { option (google.api.http).get = "/umee/historacle/v1/denoms/median_deviations"; } - - // MedianOfMedians returns the median of a specified amount of - // stamped medians - rpc MedianOfMedians(QueryMedianOfMedians) - returns (QueryMedianOfMediansResponse) { - option (google.api.http).get = - "/umee/historacle/v1/denoms/median_of_medians"; - } - - // AverageOfMedians returns the average of a specified amount of - // stamped medians - rpc AverageOfMedians(QueryAverageOfMedians) - returns (QueryAverageOfMediansResponse) { - option (google.api.http).get = - "/umee/historacle/v1/denoms/average_of_medians"; - } - - // MinOfMedians returns the min of a specified amount of - // stamped medians - rpc MinOfMedians(QueryMinOfMedians) - returns (QueryMinOfMediansResponse) { - option (google.api.http).get = - "/umee/historacle/v1/denoms/min_of_medians"; - } - - // MaxOfMedians returns the max of a specified amount of - // stamped medians - rpc MaxOfMedians(QueryMaxOfMedians) - returns (QueryMaxOfMediansResponse) { - option (google.api.http).get = - "/umee/historacle/v1/denoms/max_of_medians"; - } } // QueryExchangeRates is the request type for the Query/ExchangeRate RPC @@ -315,83 +283,3 @@ message QueryMedianDeviationsResponse { (gogoproto.nullable) = false ]; } - -// QueryMedianOfMedians is the request type for the Query/MedianOfMedians RPC Response. -message QueryMedianOfMedians { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - // denom defines the denomination to query for. - string denom = 1; - // numStamps defines the number of median stamps to query for. - uint64 numStamps = 2; -} - -// QueryMedianOfMediansResponse is response type for the -// Query/MedianOfMediansResponse RPC method. -message QueryMedianOfMediansResponse { - // medianOfMedian defines a median of stamped medians. - cosmos.base.v1beta1.DecCoin medianOfMedians = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoin", - (gogoproto.nullable) = false - ]; -} - -// QueryAverageOfMedians is the request type for the Query/AverageOfMedians RPC Response. -message QueryAverageOfMedians { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - // denom defines the denomination to query for. - string denom = 1; - // numStamps defines the number of median stamps to query for. - uint64 numStamps = 2; -} - -// QueryAverageOfMediansResponse is response type for the -// Query/AverageOfMediansResponse RPC method. -message QueryAverageOfMediansResponse { - // averageOfMedian defines a average of stamped medians. - cosmos.base.v1beta1.DecCoin averageOfMedians = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoin", - (gogoproto.nullable) = false - ]; -} - -// QueryMinOfMedians is the request type for the Query/MinOfMedians RPC Response. -message QueryMinOfMedians { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - // denom defines the denomination to query for. - string denom = 1; - // numStamps defines the number of median stamps to query for. - uint64 numStamps = 2; -} - -// QueryMinOfMediansResponse is response type for the -// Query/MinOfMediansResponse RPC method. -message QueryMinOfMediansResponse { - // minOfMedian defines a min of stamped medians. - cosmos.base.v1beta1.DecCoin minOfMedians = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoin", - (gogoproto.nullable) = false - ]; -} - -// QueryMaxOfMedians is the request type for the Query/MaxOfMedians RPC Response. -message QueryMaxOfMedians { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - // denom defines the denomination to query for. - string denom = 1; - // numStamps defines the number of median stamps to query for. - uint64 numStamps = 2; -} - -// QueryMaxOfMediansResponse is response type for the -// Query/MaxOfMediansResponse RPC method. -message QueryMaxOfMediansResponse { - // maxOfMedian defines a max of stamped medians. - cosmos.base.v1beta1.DecCoin maxOfMedians = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoin", - (gogoproto.nullable) = false - ]; -} diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index c638c7e63e..be822efdfd 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -314,91 +314,3 @@ func (q querier) MedianDeviations( return &types.QueryMedianDeviationsResponse{MedianDeviations: medians}, nil } - -// MedianOfMedians queries the median of a specified amount of stamped medians of -// a denom -func (q querier) MedianOfMedians( - goCtx context.Context, - req *types.QueryMedianOfMedians, -) (*types.QueryMedianOfMediansResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - medianOfMedians, err := q.MedianOfHistoricMedians(ctx, req.Denom, req.NumStamps) - if err != nil { - return nil, err - } - - medianResp := sdk.NewDecCoinFromDec(req.Denom, medianOfMedians) - - return &types.QueryMedianOfMediansResponse{MedianOfMedians: medianResp}, nil -} - -// AverageOfMedians queries the average of a specified amount of stamped medians of -// a denom -func (q querier) AverageOfMedians( - goCtx context.Context, - req *types.QueryAverageOfMedians, -) (*types.QueryAverageOfMediansResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - averageOfMedians, err := q.AverageOfHistoricMedians(ctx, req.Denom, req.NumStamps) - if err != nil { - return nil, err - } - - averageResp := sdk.NewDecCoinFromDec(req.Denom, averageOfMedians) - - return &types.QueryAverageOfMediansResponse{AverageOfMedians: averageResp}, nil -} - -// MinOfMedians queries the min of a specified amount of stamped medians of -// a denom -func (q querier) MinOfMedians( - goCtx context.Context, - req *types.QueryMinOfMedians, -) (*types.QueryMinOfMediansResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - minOfMedians, err := q.MinOfHistoricMedians(ctx, req.Denom, req.NumStamps) - if err != nil { - return nil, err - } - - minResp := sdk.NewDecCoinFromDec(req.Denom, minOfMedians) - - return &types.QueryMinOfMediansResponse{MinOfMedians: minResp}, nil -} - -// MaxOfMedians queries the max of a specified amount of stamped medians of -// a denom -func (q querier) MaxOfMedians( - goCtx context.Context, - req *types.QueryMaxOfMedians, -) (*types.QueryMaxOfMediansResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - maxOfMedians, err := q.MaxOfHistoricMedians(ctx, req.Denom, req.NumStamps) - if err != nil { - return nil, err - } - - maxResp := sdk.NewDecCoinFromDec(req.Denom, maxOfMedians) - - return &types.QueryMaxOfMediansResponse{MaxOfMedians: maxResp}, nil -} diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go index 4ab0da4b42..1e1d1b5668 100644 --- a/x/oracle/keeper/grpc_query_test.go +++ b/x/oracle/keeper/grpc_query_test.go @@ -241,74 +241,6 @@ func (s *IntegrationTestSuite) TestQuerier_MedianDeviations() { s.Require().Equal(res.MedianDeviations, sdk.NewDecCoins(atomMedianDeviation)) } -func (s *IntegrationTestSuite) TestQuerier_MedianOfMedians() { - app, ctx := s.app, s.ctx - - umeeMedian1 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6523.38")} - umeeMedian2 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} - umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} - - app.OracleKeeper.SetMedianStampPeriod(ctx, 1) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) - - res, err := s.queryClient.MedianOfMedians(ctx.Context(), &types.QueryMedianOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) - s.Require().NoError(err) - s.Require().Equal(res.MedianOfMedians, umeeMedian3) -} - -func (s *IntegrationTestSuite) TestQuerier_AverageOfMedians() { - app, ctx := s.app, s.ctx - - umeeMedian1 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6523.38")} - umeeMedian2 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} - umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} - - app.OracleKeeper.SetMedianStampPeriod(ctx, 1) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) - - res, err := s.queryClient.AverageOfMedians(ctx.Context(), &types.QueryAverageOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) - s.Require().NoError(err) - s.Require().Equal(res.AverageOfMedians, sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.593333333333333333")}) -} - -func (s *IntegrationTestSuite) TestQuerier_MinOfMedians() { - app, ctx := s.app, s.ctx - - umeeMedian1 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6523.38")} - umeeMedian2 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} - umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} - - app.OracleKeeper.SetMedianStampPeriod(ctx, 1) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) - - res, err := s.queryClient.MinOfMedians(ctx.Context(), &types.QueryMinOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) - s.Require().NoError(err) - s.Require().Equal(res.MinOfMedians, umeeMedian1) -} - -func (s *IntegrationTestSuite) TestQuerier_MaxOfMedians() { - app, ctx := s.app, s.ctx - - umeeMedian1 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6523.38")} - umeeMedian2 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} - umeeMedian3 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6532.92")} - - app.OracleKeeper.SetMedianStampPeriod(ctx, 1) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-1), umeeMedian1.Amount) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian2.Denom, uint64(ctx.BlockHeight()-2), umeeMedian2.Amount) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian3.Denom, uint64(ctx.BlockHeight()-3), umeeMedian3.Amount) - - res, err := s.queryClient.MaxOfMedians(ctx.Context(), &types.QueryMaxOfMedians{Denom: umeeMedian1.Denom, NumStamps: 3}) - s.Require().NoError(err) - s.Require().Equal(res.MaxOfMedians, umeeMedian2) -} - func (s *IntegrationTestSuite) TestEmptyRequest() { q := keeper.NewQuerier(keeper.Keeper{}) const emptyRequestErrorMsg = "empty request" diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 523bab9d52..31096c84d9 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -986,330 +986,6 @@ func (m *QueryMedianDeviationsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMedianDeviationsResponse proto.InternalMessageInfo -// QueryMedianOfMedians is the request type for the Query/MedianOfMedians RPC Response. -type QueryMedianOfMedians struct { - // denom defines the denomination to query for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - // numStamps defines the number of median stamps to query for. - NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` -} - -func (m *QueryMedianOfMedians) Reset() { *m = QueryMedianOfMedians{} } -func (m *QueryMedianOfMedians) String() string { return proto.CompactTextString(m) } -func (*QueryMedianOfMedians) ProtoMessage() {} -func (*QueryMedianOfMedians) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{24} -} -func (m *QueryMedianOfMedians) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMedianOfMedians) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMedianOfMedians.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryMedianOfMedians) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMedianOfMedians.Merge(m, src) -} -func (m *QueryMedianOfMedians) XXX_Size() int { - return m.Size() -} -func (m *QueryMedianOfMedians) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMedianOfMedians.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMedianOfMedians proto.InternalMessageInfo - -// QueryMedianOfMediansResponse is response type for the -// Query/MedianOfMediansResponse RPC method. -type QueryMedianOfMediansResponse struct { - // medianOfMedian defines a median of stamped medians. - MedianOfMedians types.DecCoin `protobuf:"bytes,1,opt,name=medianOfMedians,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"medianOfMedians"` -} - -func (m *QueryMedianOfMediansResponse) Reset() { *m = QueryMedianOfMediansResponse{} } -func (m *QueryMedianOfMediansResponse) String() string { return proto.CompactTextString(m) } -func (*QueryMedianOfMediansResponse) ProtoMessage() {} -func (*QueryMedianOfMediansResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{25} -} -func (m *QueryMedianOfMediansResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMedianOfMediansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMedianOfMediansResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryMedianOfMediansResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMedianOfMediansResponse.Merge(m, src) -} -func (m *QueryMedianOfMediansResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryMedianOfMediansResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMedianOfMediansResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMedianOfMediansResponse proto.InternalMessageInfo - -// QueryAverageOfMedians is the request type for the Query/AverageOfMedians RPC Response. -type QueryAverageOfMedians struct { - // denom defines the denomination to query for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - // numStamps defines the number of median stamps to query for. - NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` -} - -func (m *QueryAverageOfMedians) Reset() { *m = QueryAverageOfMedians{} } -func (m *QueryAverageOfMedians) String() string { return proto.CompactTextString(m) } -func (*QueryAverageOfMedians) ProtoMessage() {} -func (*QueryAverageOfMedians) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{26} -} -func (m *QueryAverageOfMedians) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAverageOfMedians) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAverageOfMedians.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAverageOfMedians) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAverageOfMedians.Merge(m, src) -} -func (m *QueryAverageOfMedians) XXX_Size() int { - return m.Size() -} -func (m *QueryAverageOfMedians) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAverageOfMedians.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAverageOfMedians proto.InternalMessageInfo - -// QueryAverageOfMediansResponse is response type for the -// Query/AverageOfMediansResponse RPC method. -type QueryAverageOfMediansResponse struct { - // averageOfMedian defines a average of stamped medians. - AverageOfMedians types.DecCoin `protobuf:"bytes,1,opt,name=averageOfMedians,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"averageOfMedians"` -} - -func (m *QueryAverageOfMediansResponse) Reset() { *m = QueryAverageOfMediansResponse{} } -func (m *QueryAverageOfMediansResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAverageOfMediansResponse) ProtoMessage() {} -func (*QueryAverageOfMediansResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{27} -} -func (m *QueryAverageOfMediansResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAverageOfMediansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAverageOfMediansResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAverageOfMediansResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAverageOfMediansResponse.Merge(m, src) -} -func (m *QueryAverageOfMediansResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAverageOfMediansResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAverageOfMediansResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAverageOfMediansResponse proto.InternalMessageInfo - -// QueryMinOfMedians is the request type for the Query/MinOfMedians RPC Response. -type QueryMinOfMedians struct { - // denom defines the denomination to query for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - // numStamps defines the number of median stamps to query for. - NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` -} - -func (m *QueryMinOfMedians) Reset() { *m = QueryMinOfMedians{} } -func (m *QueryMinOfMedians) String() string { return proto.CompactTextString(m) } -func (*QueryMinOfMedians) ProtoMessage() {} -func (*QueryMinOfMedians) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{28} -} -func (m *QueryMinOfMedians) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMinOfMedians) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMinOfMedians.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryMinOfMedians) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMinOfMedians.Merge(m, src) -} -func (m *QueryMinOfMedians) XXX_Size() int { - return m.Size() -} -func (m *QueryMinOfMedians) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMinOfMedians.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMinOfMedians proto.InternalMessageInfo - -// QueryMinOfMediansResponse is response type for the -// Query/MinOfMediansResponse RPC method. -type QueryMinOfMediansResponse struct { - // minOfMedian defines a min of stamped medians. - MinOfMedians types.DecCoin `protobuf:"bytes,1,opt,name=minOfMedians,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"minOfMedians"` -} - -func (m *QueryMinOfMediansResponse) Reset() { *m = QueryMinOfMediansResponse{} } -func (m *QueryMinOfMediansResponse) String() string { return proto.CompactTextString(m) } -func (*QueryMinOfMediansResponse) ProtoMessage() {} -func (*QueryMinOfMediansResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{29} -} -func (m *QueryMinOfMediansResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMinOfMediansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMinOfMediansResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryMinOfMediansResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMinOfMediansResponse.Merge(m, src) -} -func (m *QueryMinOfMediansResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryMinOfMediansResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMinOfMediansResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMinOfMediansResponse proto.InternalMessageInfo - -// QueryMaxOfMedians is the request type for the Query/MaxOfMedians RPC Response. -type QueryMaxOfMedians struct { - // denom defines the denomination to query for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - // numStamps defines the number of median stamps to query for. - NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` -} - -func (m *QueryMaxOfMedians) Reset() { *m = QueryMaxOfMedians{} } -func (m *QueryMaxOfMedians) String() string { return proto.CompactTextString(m) } -func (*QueryMaxOfMedians) ProtoMessage() {} -func (*QueryMaxOfMedians) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{30} -} -func (m *QueryMaxOfMedians) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMaxOfMedians) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMaxOfMedians.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryMaxOfMedians) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMaxOfMedians.Merge(m, src) -} -func (m *QueryMaxOfMedians) XXX_Size() int { - return m.Size() -} -func (m *QueryMaxOfMedians) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMaxOfMedians.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMaxOfMedians proto.InternalMessageInfo - -// QueryMaxOfMediansResponse is response type for the -// Query/MaxOfMediansResponse RPC method. -type QueryMaxOfMediansResponse struct { - // maxOfMedian defines a max of stamped medians. - MaxOfMedians types.DecCoin `protobuf:"bytes,1,opt,name=maxOfMedians,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"maxOfMedians"` -} - -func (m *QueryMaxOfMediansResponse) Reset() { *m = QueryMaxOfMediansResponse{} } -func (m *QueryMaxOfMediansResponse) String() string { return proto.CompactTextString(m) } -func (*QueryMaxOfMediansResponse) ProtoMessage() {} -func (*QueryMaxOfMediansResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710e319bc1815d33, []int{31} -} -func (m *QueryMaxOfMediansResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMaxOfMediansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMaxOfMediansResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryMaxOfMediansResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMaxOfMediansResponse.Merge(m, src) -} -func (m *QueryMaxOfMediansResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryMaxOfMediansResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMaxOfMediansResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMaxOfMediansResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*QueryExchangeRates)(nil), "umee.oracle.v1.QueryExchangeRates") proto.RegisterType((*QueryExchangeRatesResponse)(nil), "umee.oracle.v1.QueryExchangeRatesResponse") @@ -1335,106 +1011,84 @@ func init() { proto.RegisterType((*QueryMediansResponse)(nil), "umee.oracle.v1.QueryMediansResponse") proto.RegisterType((*QueryMedianDeviations)(nil), "umee.oracle.v1.QueryMedianDeviations") proto.RegisterType((*QueryMedianDeviationsResponse)(nil), "umee.oracle.v1.QueryMedianDeviationsResponse") - proto.RegisterType((*QueryMedianOfMedians)(nil), "umee.oracle.v1.QueryMedianOfMedians") - proto.RegisterType((*QueryMedianOfMediansResponse)(nil), "umee.oracle.v1.QueryMedianOfMediansResponse") - proto.RegisterType((*QueryAverageOfMedians)(nil), "umee.oracle.v1.QueryAverageOfMedians") - proto.RegisterType((*QueryAverageOfMediansResponse)(nil), "umee.oracle.v1.QueryAverageOfMediansResponse") - proto.RegisterType((*QueryMinOfMedians)(nil), "umee.oracle.v1.QueryMinOfMedians") - proto.RegisterType((*QueryMinOfMediansResponse)(nil), "umee.oracle.v1.QueryMinOfMediansResponse") - proto.RegisterType((*QueryMaxOfMedians)(nil), "umee.oracle.v1.QueryMaxOfMedians") - proto.RegisterType((*QueryMaxOfMediansResponse)(nil), "umee.oracle.v1.QueryMaxOfMediansResponse") } func init() { proto.RegisterFile("umee/oracle/v1/query.proto", fileDescriptor_710e319bc1815d33) } var fileDescriptor_710e319bc1815d33 = []byte{ - // 1361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0xbd, 0xa5, 0x3f, 0xe8, 0x73, 0xe3, 0x38, 0xd3, 0x1f, 0x0a, 0x5b, 0xe3, 0xa4, 0xd3, - 0x16, 0xd2, 0x34, 0xd9, 0x6d, 0xdc, 0x20, 0x50, 0x45, 0x05, 0x4d, 0x1a, 0x84, 0x44, 0x11, 0xad, - 0x0b, 0x05, 0x71, 0xb1, 0x26, 0xf6, 0xd4, 0x59, 0x1a, 0xef, 0x9a, 0x9d, 0x8d, 0x93, 0x52, 0x2a, - 0x10, 0xbd, 0x20, 0x2e, 0x80, 0x2a, 0xf5, 0x00, 0xa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2f, 0xff, - 0xc3, 0xe7, 0xd9, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x04, 0xa1, 0x84, 0x22, 0x97, 0x15, 0x00, - 0x00, + // 1151 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0xbd, 0xa5, 0x4d, 0xc9, 0x73, 0xed, 0x3a, 0xd3, 0x34, 0xb2, 0x36, 0xc1, 0x09, 0xdb, + 0x14, 0x42, 0x9a, 0xec, 0x36, 0x4e, 0x10, 0x28, 0xa2, 0x82, 0xfc, 0x42, 0x48, 0x14, 0x29, 0xb8, + 0x52, 0x40, 0x5c, 0xac, 0x89, 0x77, 0x70, 0x96, 0x64, 0x77, 0xcc, 0xce, 0xc6, 0x49, 0x54, 0x45, + 0x20, 0x7a, 0xe1, 0x88, 0x54, 0x29, 0xc7, 0xaa, 0x02, 0x04, 0x12, 0x17, 0xfe, 0x8d, 0x1c, 0x2b, + 0x71, 0xe1, 0xc4, 0x8f, 0x84, 0x03, 0x7f, 0x46, 0xb5, 0x33, 0xe3, 0xc9, 0xfe, 0x72, 0xec, 0x54, + 0xea, 0x29, 0xf1, 0x7b, 0x6f, 0xde, 0xf7, 0x33, 0x6f, 0x77, 0xe6, 0x6b, 0x83, 0xbe, 0xeb, 0x12, + 0x62, 0x51, 0x1f, 0x37, 0x76, 0x88, 0xd5, 0x9e, 0xb3, 0xbe, 0xde, 0x25, 0xfe, 0x81, 0xd9, 0xf2, + 0x69, 0x40, 0x51, 0x31, 0xcc, 0x99, 0x22, 0x67, 0xb6, 0xe7, 0xf4, 0xe1, 0x26, 0x6d, 0x52, 0x9e, + 0xb2, 0xc2, 0xff, 0x44, 0x95, 0x3e, 0xd6, 0xa4, 0xb4, 0xb9, 0x43, 0x2c, 0xdc, 0x72, 0x2c, 0xec, + 0x79, 0x34, 0xc0,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ef, 0xf6, 0x73, 0xb0, 0xea, 0xb6, 0x5a, 0xbd, 0x7c, 0xff, 0xf8, 0xdf, 0x4a, 0xee, 0xf8, 0xa4, + 0xa2, 0x3d, 0x3b, 0xa9, 0x68, 0xff, 0x9c, 0x54, 0xb4, 0x1f, 0x4e, 0x2b, 0xb9, 0x67, 0xa7, 0x95, + 0xdc, 0x9f, 0xa7, 0x95, 0xdc, 0x17, 0x66, 0xc4, 0x85, 0xc3, 0xae, 0xb3, 0x1e, 0x09, 0xf6, 0xa8, + 0xbf, 0x2d, 0x24, 0xda, 0xf3, 0xd6, 0x7e, 0x67, 0xda, 0xdc, 0x91, 0x37, 0x07, 0xf8, 0x8f, 0xdb, + 0xf9, 0xe7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x4c, 0xb1, 0x4d, 0x7b, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1476,18 +1130,6 @@ type QueryClient interface { // MedianDeviations returns median deviations of all denoms, // or, if specified, returns a single median deviation MedianDeviations(ctx context.Context, in *QueryMedianDeviations, opts ...grpc.CallOption) (*QueryMedianDeviationsResponse, error) - // MedianOfMedians returns the median of a specified amount of - // stamped medians - MedianOfMedians(ctx context.Context, in *QueryMedianOfMedians, opts ...grpc.CallOption) (*QueryMedianOfMediansResponse, error) - // AverageOfMedians returns the average of a specified amount of - // stamped medians - AverageOfMedians(ctx context.Context, in *QueryAverageOfMedians, opts ...grpc.CallOption) (*QueryAverageOfMediansResponse, error) - // MinOfMedians returns the min of a specified amount of - // stamped medians - MinOfMedians(ctx context.Context, in *QueryMinOfMedians, opts ...grpc.CallOption) (*QueryMinOfMediansResponse, error) - // MaxOfMedians returns the max of a specified amount of - // stamped medians - MaxOfMedians(ctx context.Context, in *QueryMaxOfMedians, opts ...grpc.CallOption) (*QueryMaxOfMediansResponse, error) } type queryClient struct { @@ -1606,42 +1248,6 @@ func (c *queryClient) MedianDeviations(ctx context.Context, in *QueryMedianDevia return out, nil } -func (c *queryClient) MedianOfMedians(ctx context.Context, in *QueryMedianOfMedians, opts ...grpc.CallOption) (*QueryMedianOfMediansResponse, error) { - out := new(QueryMedianOfMediansResponse) - err := c.cc.Invoke(ctx, "/umee.oracle.v1.Query/MedianOfMedians", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AverageOfMedians(ctx context.Context, in *QueryAverageOfMedians, opts ...grpc.CallOption) (*QueryAverageOfMediansResponse, error) { - out := new(QueryAverageOfMediansResponse) - err := c.cc.Invoke(ctx, "/umee.oracle.v1.Query/AverageOfMedians", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) MinOfMedians(ctx context.Context, in *QueryMinOfMedians, opts ...grpc.CallOption) (*QueryMinOfMediansResponse, error) { - out := new(QueryMinOfMediansResponse) - err := c.cc.Invoke(ctx, "/umee.oracle.v1.Query/MinOfMedians", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) MaxOfMedians(ctx context.Context, in *QueryMaxOfMedians, opts ...grpc.CallOption) (*QueryMaxOfMediansResponse, error) { - out := new(QueryMaxOfMediansResponse) - err := c.cc.Invoke(ctx, "/umee.oracle.v1.Query/MaxOfMedians", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // ExchangeRates returns exchange rates of all denoms, @@ -1671,18 +1277,6 @@ type QueryServer interface { // MedianDeviations returns median deviations of all denoms, // or, if specified, returns a single median deviation MedianDeviations(context.Context, *QueryMedianDeviations) (*QueryMedianDeviationsResponse, error) - // MedianOfMedians returns the median of a specified amount of - // stamped medians - MedianOfMedians(context.Context, *QueryMedianOfMedians) (*QueryMedianOfMediansResponse, error) - // AverageOfMedians returns the average of a specified amount of - // stamped medians - AverageOfMedians(context.Context, *QueryAverageOfMedians) (*QueryAverageOfMediansResponse, error) - // MinOfMedians returns the min of a specified amount of - // stamped medians - MinOfMedians(context.Context, *QueryMinOfMedians) (*QueryMinOfMediansResponse, error) - // MaxOfMedians returns the max of a specified amount of - // stamped medians - MaxOfMedians(context.Context, *QueryMaxOfMedians) (*QueryMaxOfMediansResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1725,18 +1319,6 @@ func (*UnimplementedQueryServer) Medians(ctx context.Context, req *QueryMedians) func (*UnimplementedQueryServer) MedianDeviations(ctx context.Context, req *QueryMedianDeviations) (*QueryMedianDeviationsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MedianDeviations not implemented") } -func (*UnimplementedQueryServer) MedianOfMedians(ctx context.Context, req *QueryMedianOfMedians) (*QueryMedianOfMediansResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MedianOfMedians not implemented") -} -func (*UnimplementedQueryServer) AverageOfMedians(ctx context.Context, req *QueryAverageOfMedians) (*QueryAverageOfMediansResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AverageOfMedians not implemented") -} -func (*UnimplementedQueryServer) MinOfMedians(ctx context.Context, req *QueryMinOfMedians) (*QueryMinOfMediansResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MinOfMedians not implemented") -} -func (*UnimplementedQueryServer) MaxOfMedians(ctx context.Context, req *QueryMaxOfMedians) (*QueryMaxOfMediansResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MaxOfMedians not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1958,78 +1540,6 @@ func _Query_MedianDeviations_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _Query_MedianOfMedians_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryMedianOfMedians) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).MedianOfMedians(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/umee.oracle.v1.Query/MedianOfMedians", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MedianOfMedians(ctx, req.(*QueryMedianOfMedians)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AverageOfMedians_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAverageOfMedians) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AverageOfMedians(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/umee.oracle.v1.Query/AverageOfMedians", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AverageOfMedians(ctx, req.(*QueryAverageOfMedians)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_MinOfMedians_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryMinOfMedians) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).MinOfMedians(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/umee.oracle.v1.Query/MinOfMedians", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MinOfMedians(ctx, req.(*QueryMinOfMedians)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_MaxOfMedians_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryMaxOfMedians) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).MaxOfMedians(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/umee.oracle.v1.Query/MaxOfMedians", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MaxOfMedians(ctx, req.(*QueryMaxOfMedians)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "umee.oracle.v1.Query", HandlerType: (*QueryServer)(nil), @@ -2082,22 +1592,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "MedianDeviations", Handler: _Query_MedianDeviations_Handler, }, - { - MethodName: "MedianOfMedians", - Handler: _Query_MedianOfMedians_Handler, - }, - { - MethodName: "AverageOfMedians", - Handler: _Query_AverageOfMedians_Handler, - }, - { - MethodName: "MinOfMedians", - Handler: _Query_MinOfMedians_Handler, - }, - { - MethodName: "MaxOfMedians", - Handler: _Query_MaxOfMedians_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "umee/oracle/v1/query.proto", @@ -2835,441 +2329,169 @@ func (m *QueryMedianDeviationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryMedianOfMedians) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil -} - -func (m *QueryMedianOfMedians) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *QueryMedianOfMedians) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryExchangeRates) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.NumStamps != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.NumStamps)) - i-- - dAtA[i] = 0x10 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *QueryMedianOfMediansResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryExchangeRatesResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryMedianOfMediansResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMedianOfMediansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - { - size, err := m.MedianOfMedians.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.ExchangeRates) > 0 { + for _, e := range m.ExchangeRates { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return n } -func (m *QueryAverageOfMedians) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryActiveExchangeRates) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *QueryAverageOfMedians) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + return n } -func (m *QueryAverageOfMedians) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryActiveExchangeRatesResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.NumStamps != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.NumStamps)) - i-- - dAtA[i] = 0x10 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa + if len(m.ActiveRates) > 0 { + for _, s := range m.ActiveRates { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } } - return len(dAtA) - i, nil + return n } -func (m *QueryAverageOfMediansResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryFeederDelegation) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryAverageOfMediansResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryFeederDelegationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FeederAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryAverageOfMediansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QueryMissCounter) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - { - size, err := m.AverageOfMedians.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return n } -func (m *QueryMinOfMedians) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryMissCounterResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + if m.MissCounter != 0 { + n += 1 + sovQuery(uint64(m.MissCounter)) + } + return n } -func (m *QueryMinOfMedians) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QuerySlashWindow) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n } -func (m *QueryMinOfMedians) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *QuerySlashWindowResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.NumStamps != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.NumStamps)) - i-- - dAtA[i] = 0x10 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa + if m.WindowProgress != 0 { + n += 1 + sovQuery(uint64(m.WindowProgress)) } - return len(dAtA) - i, nil + return n } -func (m *QueryMinOfMediansResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryAggregatePrevote) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryMinOfMediansResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryAggregatePrevoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.AggregatePrevote.Size() + n += 1 + l + sovQuery(uint64(l)) + return n } -func (m *QueryMinOfMediansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.MinOfMedians.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryMaxOfMedians) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryMaxOfMedians) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMaxOfMedians) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumStamps != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.NumStamps)) - i-- - dAtA[i] = 0x10 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryMaxOfMediansResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryMaxOfMediansResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMaxOfMediansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.MaxOfMedians.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryExchangeRates) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryExchangeRatesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ExchangeRates) > 0 { - for _, e := range m.ExchangeRates { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryActiveExchangeRates) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryActiveExchangeRatesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ActiveRates) > 0 { - for _, s := range m.ActiveRates { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryFeederDelegation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryFeederDelegationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FeederAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryMissCounter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryMissCounterResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MissCounter != 0 { - n += 1 + sovQuery(uint64(m.MissCounter)) - } - return n -} - -func (m *QuerySlashWindow) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QuerySlashWindowResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.WindowProgress != 0 { - n += 1 + sovQuery(uint64(m.WindowProgress)) - } - return n -} - -func (m *QueryAggregatePrevote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAggregatePrevoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.AggregatePrevote.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAggregatePrevotes) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryAggregatePrevotes) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l return n @@ -3417,116 +2639,8 @@ func (m *QueryMedianDeviationsResponse) Size() (n int) { return n } -func (m *QueryMedianOfMedians) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.NumStamps != 0 { - n += 1 + sovQuery(uint64(m.NumStamps)) - } - return n -} - -func (m *QueryMedianOfMediansResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.MedianOfMedians.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAverageOfMedians) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.NumStamps != 0 { - n += 1 + sovQuery(uint64(m.NumStamps)) - } - return n -} - -func (m *QueryAverageOfMediansResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.AverageOfMedians.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryMinOfMedians) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.NumStamps != 0 { - n += 1 + sovQuery(uint64(m.NumStamps)) - } - return n -} - -func (m *QueryMinOfMediansResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.MinOfMedians.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryMaxOfMedians) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.NumStamps != 0 { - n += 1 + sovQuery(uint64(m.NumStamps)) - } - return n -} - -func (m *QueryMaxOfMediansResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.MaxOfMedians.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -3591,588 +2705,7 @@ func (m *QueryExchangeRates) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryExchangeRatesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryExchangeRatesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExchangeRatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExchangeRates", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExchangeRates = append(m.ExchangeRates, types.DecCoin{}) - if err := m.ExchangeRates[len(m.ExchangeRates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryActiveExchangeRates) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryActiveExchangeRates: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryActiveExchangeRates: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryActiveExchangeRatesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryActiveExchangeRatesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryActiveExchangeRatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActiveRates", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActiveRates = append(m.ActiveRates, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryFeederDelegation) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryFeederDelegation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryFeederDelegation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryFeederDelegationResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryFeederDelegationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryFeederDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeederAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FeederAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryMissCounter) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryMissCounter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMissCounter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryMissCounterResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryMissCounterResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMissCounterResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MissCounter", wireType) - } - m.MissCounter = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MissCounter |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySlashWindow) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySlashWindow: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySlashWindow: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4194,7 +2727,7 @@ func (m *QuerySlashWindow) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { +func (m *QueryExchangeRatesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4217,17 +2750,17 @@ func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySlashWindowResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryExchangeRatesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySlashWindowResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryExchangeRatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WindowProgress", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeRates", wireType) } - m.WindowProgress = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4237,11 +2770,26 @@ func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WindowProgress |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExchangeRates = append(m.ExchangeRates, types.DecCoin{}) + if err := m.ExchangeRates[len(m.ExchangeRates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4263,7 +2811,7 @@ func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregatePrevote) Unmarshal(dAtA []byte) error { +func (m *QueryActiveExchangeRates) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4286,44 +2834,12 @@ func (m *QueryAggregatePrevote) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregatePrevote: wiretype end group for non-group") + return fmt.Errorf("proto: QueryActiveExchangeRates: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregatePrevote: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryActiveExchangeRates: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4345,7 +2861,7 @@ func (m *QueryAggregatePrevote) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { +func (m *QueryActiveExchangeRatesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4368,17 +2884,17 @@ func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregatePrevoteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryActiveExchangeRatesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregatePrevoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryActiveExchangeRatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregatePrevote", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ActiveRates", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4388,24 +2904,23 @@ func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AggregatePrevote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ActiveRates = append(m.ActiveRates, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -4428,7 +2943,7 @@ func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregatePrevotes) Unmarshal(dAtA []byte) error { +func (m *QueryFeederDelegation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4451,12 +2966,44 @@ func (m *QueryAggregatePrevotes) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregatePrevotes: wiretype end group for non-group") + return fmt.Errorf("proto: QueryFeederDelegation: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregatePrevotes: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryFeederDelegation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4478,7 +3025,7 @@ func (m *QueryAggregatePrevotes) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryFeederDelegationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4501,17 +3048,17 @@ func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregatePrevotesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryFeederDelegationResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregatePrevotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryFeederDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregatePrevotes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeederAddr", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4521,25 +3068,23 @@ func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.AggregatePrevotes = append(m.AggregatePrevotes, AggregateExchangeRatePrevote{}) - if err := m.AggregatePrevotes[len(m.AggregatePrevotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.FeederAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4562,7 +3107,7 @@ func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregateVote) Unmarshal(dAtA []byte) error { +func (m *QueryMissCounter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4585,10 +3130,10 @@ func (m *QueryAggregateVote) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregateVote: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMissCounter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregateVote: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMissCounter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4644,7 +3189,7 @@ func (m *QueryAggregateVote) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMissCounterResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4667,17 +3212,17 @@ func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregateVoteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMissCounterResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregateVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMissCounterResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateVote", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MissCounter", wireType) } - var msglen int + m.MissCounter = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4687,25 +3232,11 @@ func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.MissCounter |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AggregateVote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4727,7 +3258,7 @@ func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregateVotes) Unmarshal(dAtA []byte) error { +func (m *QuerySlashWindow) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4750,10 +3281,10 @@ func (m *QueryAggregateVotes) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregateVotes: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySlashWindow: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregateVotes: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySlashWindow: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -4777,7 +3308,7 @@ func (m *QueryAggregateVotes) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySlashWindowResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4800,17 +3331,17 @@ func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAggregateVotesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySlashWindowResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAggregateVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySlashWindowResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateVotes", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WindowProgress", wireType) } - var msglen int + m.WindowProgress = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4820,26 +3351,11 @@ func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.WindowProgress |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AggregateVotes = append(m.AggregateVotes, AggregateExchangeRateVote{}) - if err := m.AggregateVotes[len(m.AggregateVotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4861,7 +3377,7 @@ func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParams) Unmarshal(dAtA []byte) error { +func (m *QueryAggregatePrevote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4884,12 +3400,44 @@ func (m *QueryParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParams: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregatePrevote: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregatePrevote: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4911,7 +3459,7 @@ func (m *QueryParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAggregatePrevoteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4934,15 +3482,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregatePrevoteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregatePrevoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggregatePrevote", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4969,7 +3517,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AggregatePrevote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4994,7 +3542,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMedians) Unmarshal(dAtA []byte) error { +func (m *QueryAggregatePrevotes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5017,63 +3565,12 @@ func (m *QueryMedians) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMedians: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregatePrevotes: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMedians: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregatePrevotes: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumStamps", wireType) - } - m.NumStamps = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumStamps |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5095,7 +3592,7 @@ func (m *QueryMedians) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAggregatePrevotesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5118,15 +3615,15 @@ func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMediansResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregatePrevotesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregatePrevotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Medians", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggregatePrevotes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5153,8 +3650,8 @@ func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Medians = append(m.Medians, types.DecCoin{}) - if err := m.Medians[len(m.Medians)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AggregatePrevotes = append(m.AggregatePrevotes, AggregateExchangeRatePrevote{}) + if err := m.AggregatePrevotes[len(m.AggregatePrevotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5179,7 +3676,7 @@ func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { +func (m *QueryAggregateVote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5202,15 +3699,15 @@ func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMedianDeviations: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregateVote: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMedianDeviations: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregateVote: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5238,7 +3735,7 @@ func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5261,7 +3758,7 @@ func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMedianDeviationsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAggregateVoteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5284,15 +3781,15 @@ func (m *QueryMedianDeviationsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMedianDeviationsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregateVoteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMedianDeviationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregateVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MedianDeviations", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggregateVote", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5319,8 +3816,7 @@ func (m *QueryMedianDeviationsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MedianDeviations = append(m.MedianDeviations, types.DecCoin{}) - if err := m.MedianDeviations[len(m.MedianDeviations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AggregateVote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5345,7 +3841,7 @@ func (m *QueryMedianDeviationsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMedianOfMedians) Unmarshal(dAtA []byte) error { +func (m *QueryAggregateVotes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5368,63 +3864,12 @@ func (m *QueryMedianOfMedians) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMedianOfMedians: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregateVotes: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMedianOfMedians: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregateVotes: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumStamps", wireType) - } - m.NumStamps = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumStamps |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5446,7 +3891,7 @@ func (m *QueryMedianOfMedians) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMedianOfMediansResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAggregateVotesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5469,15 +3914,15 @@ func (m *QueryMedianOfMediansResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMedianOfMediansResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAggregateVotesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMedianOfMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAggregateVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MedianOfMedians", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggregateVotes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5504,7 +3949,8 @@ func (m *QueryMedianOfMediansResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MedianOfMedians.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AggregateVotes = append(m.AggregateVotes, AggregateExchangeRateVote{}) + if err := m.AggregateVotes[len(m.AggregateVotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5529,7 +3975,7 @@ func (m *QueryMedianOfMediansResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAverageOfMedians) Unmarshal(dAtA []byte) error { +func (m *QueryParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5552,63 +3998,12 @@ func (m *QueryAverageOfMedians) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAverageOfMedians: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAverageOfMedians: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumStamps", wireType) - } - m.NumStamps = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumStamps |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5630,7 +4025,7 @@ func (m *QueryAverageOfMedians) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAverageOfMediansResponse) Unmarshal(dAtA []byte) error { +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5653,15 +4048,15 @@ func (m *QueryAverageOfMediansResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAverageOfMediansResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAverageOfMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AverageOfMedians", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5688,7 +4083,7 @@ func (m *QueryAverageOfMediansResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AverageOfMedians.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5713,7 +4108,7 @@ func (m *QueryAverageOfMediansResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMinOfMedians) Unmarshal(dAtA []byte) error { +func (m *QueryMedians) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5736,10 +4131,10 @@ func (m *QueryMinOfMedians) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMinOfMedians: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMedians: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMinOfMedians: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMedians: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5814,7 +4209,7 @@ func (m *QueryMinOfMedians) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMinOfMediansResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMediansResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5837,15 +4232,15 @@ func (m *QueryMinOfMediansResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMinOfMediansResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMediansResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMinOfMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinOfMedians", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Medians", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5872,7 +4267,8 @@ func (m *QueryMinOfMediansResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MinOfMedians.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Medians = append(m.Medians, types.DecCoin{}) + if err := m.Medians[len(m.Medians)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5897,7 +4293,7 @@ func (m *QueryMinOfMediansResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMaxOfMedians) Unmarshal(dAtA []byte) error { +func (m *QueryMedianDeviations) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5920,10 +4316,10 @@ func (m *QueryMaxOfMedians) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMaxOfMedians: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMedianDeviations: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMaxOfMedians: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMedianDeviations: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5958,25 +4354,6 @@ func (m *QueryMaxOfMedians) Unmarshal(dAtA []byte) error { } m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumStamps", wireType) - } - m.NumStamps = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumStamps |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5998,7 +4375,7 @@ func (m *QueryMaxOfMedians) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMaxOfMediansResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMedianDeviationsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6021,15 +4398,15 @@ func (m *QueryMaxOfMediansResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMaxOfMediansResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMedianDeviationsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMaxOfMediansResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMedianDeviationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxOfMedians", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MedianDeviations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6056,7 +4433,8 @@ func (m *QueryMaxOfMediansResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MaxOfMedians.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.MedianDeviations = append(m.MedianDeviations, types.DecCoin{}) + if err := m.MedianDeviations[len(m.MedianDeviations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index bec4387b8c..761f396b21 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -465,150 +465,6 @@ func local_request_Query_MedianDeviations_0(ctx context.Context, marshaler runti } -var ( - filter_Query_MedianOfMedians_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_MedianOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMedianOfMedians - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MedianOfMedians_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.MedianOfMedians(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_MedianOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMedianOfMedians - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MedianOfMedians_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.MedianOfMedians(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AverageOfMedians_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_AverageOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAverageOfMedians - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AverageOfMedians_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AverageOfMedians(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AverageOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAverageOfMedians - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AverageOfMedians_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AverageOfMedians(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_MinOfMedians_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_MinOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMinOfMedians - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MinOfMedians_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.MinOfMedians(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_MinOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMinOfMedians - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MinOfMedians_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.MinOfMedians(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_MaxOfMedians_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_MaxOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMaxOfMedians - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MaxOfMedians_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.MaxOfMedians(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_MaxOfMedians_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMaxOfMedians - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MaxOfMedians_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.MaxOfMedians(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -891,98 +747,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_MedianOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_MedianOfMedians_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_MedianOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AverageOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AverageOfMedians_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AverageOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_MinOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_MinOfMedians_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_MinOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_MaxOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_MaxOfMedians_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_MaxOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -1264,86 +1028,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_MedianOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_MedianOfMedians_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_MedianOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AverageOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AverageOfMedians_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AverageOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_MinOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_MinOfMedians_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_MinOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_MaxOfMedians_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_MaxOfMedians_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_MaxOfMedians_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -1371,14 +1055,6 @@ var ( pattern_Query_Medians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "medians"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_MedianDeviations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "median_deviations"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_MedianOfMedians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "median_of_medians"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AverageOfMedians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "average_of_medians"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_MinOfMedians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "min_of_medians"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_MaxOfMedians_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "historacle", "v1", "denoms", "max_of_medians"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1405,12 +1081,4 @@ var ( forward_Query_Medians_0 = runtime.ForwardResponseMessage forward_Query_MedianDeviations_0 = runtime.ForwardResponseMessage - - forward_Query_MedianOfMedians_0 = runtime.ForwardResponseMessage - - forward_Query_AverageOfMedians_0 = runtime.ForwardResponseMessage - - forward_Query_MinOfMedians_0 = runtime.ForwardResponseMessage - - forward_Query_MaxOfMedians_0 = runtime.ForwardResponseMessage ) From 1a3614100868edb37f85d8c9ff3540f57e3ced9e Mon Sep 17 00:00:00 2001 From: ryanbajollari <54822716+rbajollari@users.noreply.github.com> Date: Fri, 9 Dec 2022 20:32:47 -0500 Subject: [PATCH 4/9] Update x/oracle/keeper/grpc_query.go Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com> --- x/oracle/keeper/grpc_query.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index be822efdfd..9acfd832f1 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -296,7 +296,6 @@ func (q querier) MedianDeviations( if len(req.Denom) > 0 { exchangeRate, err := q.HistoricMedianDeviation(ctx, req.Denom) - if err != nil { return nil, err } From 186a6742bcc9933fecaa84918a22be2f2b010ac8 Mon Sep 17 00:00:00 2001 From: rbajollari Date: Mon, 12 Dec 2022 10:52:39 -0500 Subject: [PATCH 5/9] Bound numStamps param in medians query --- x/oracle/abci_test.go | 24 ++++++++++++------------ x/oracle/keeper/grpc_query.go | 5 +++++ x/oracle/keeper/grpc_query_test.go | 11 +++++++++++ 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/x/oracle/abci_test.go b/x/oracle/abci_test.go index 8a3b4e0428..9963a8189f 100644 --- a/x/oracle/abci_test.go +++ b/x/oracle/abci_test.go @@ -16,8 +16,8 @@ import ( umeeapp "github.com/umee-network/umee/v3/app" appparams "github.com/umee-network/umee/v3/app/params" - "github.com/umee-network/umee/v3/x/oracle/keeper" "github.com/umee-network/umee/v3/x/oracle" + "github.com/umee-network/umee/v3/x/oracle/keeper" "github.com/umee-network/umee/v3/x/oracle/types" ) @@ -42,11 +42,11 @@ func clearHistoricPrices( ctx sdk.Context, k keeper.Keeper, denom string, - ) { - stampPeriod := int(k.HistoricStampPeriod(ctx)) +) { + stampPeriod := int(k.HistoricStampPeriod(ctx)) numStamps := int(k.MaximumPriceStamps(ctx)) - for i := 0; i < numStamps; i++ { - k.DeleteHistoricPrice(ctx, denom, uint64(ctx.BlockHeight()) - uint64(i*stampPeriod)) + for i := 0; i < numStamps; i++ { + k.DeleteHistoricPrice(ctx, denom, uint64(ctx.BlockHeight())-uint64(i*stampPeriod)) } } @@ -55,11 +55,11 @@ func clearHistoricMedians( ctx sdk.Context, k keeper.Keeper, denom string, - ) { - stampPeriod := int(k.MedianStampPeriod(ctx)) +) { + stampPeriod := int(k.MedianStampPeriod(ctx)) numStamps := int(k.MaximumMedianStamps(ctx)) for i := 0; i < numStamps; i++ { - k.DeleteHistoricMedian(ctx, denom, uint64(ctx.BlockHeight()) - uint64(i*stampPeriod)) + k.DeleteHistoricMedian(ctx, denom, uint64(ctx.BlockHeight())-uint64(i*stampPeriod)) } } @@ -69,11 +69,11 @@ func clearHistoricMedianDeviations( ctx sdk.Context, k keeper.Keeper, denom string, - ) { - stampPeriod := int(k.MedianStampPeriod(ctx)) +) { + stampPeriod := int(k.MedianStampPeriod(ctx)) numStamps := int(k.MaximumMedianStamps(ctx)) - for i := 0; i < numStamps; i++ { - k.DeleteHistoricMedianDeviation(ctx, denom, uint64(ctx.BlockHeight()) - uint64(i*stampPeriod)) + for i := 0; i < numStamps; i++ { + k.DeleteHistoricMedianDeviation(ctx, denom, uint64(ctx.BlockHeight())-uint64(i*stampPeriod)) } } diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 9acfd832f1..d211f450d5 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" @@ -262,6 +263,10 @@ func (q querier) Medians( ctx := sdk.UnwrapSDKContext(goCtx) + if req.NumStamps > q.MaximumMedianStamps(ctx) { + return nil, status.Error(codes.OutOfRange, fmt.Sprintf("numStamps must be less than %d", q.MaximumMedianStamps(ctx))) + } + var medians sdk.DecCoins if len(req.Denom) > 0 { diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go index 1e1d1b5668..0763571792 100644 --- a/x/oracle/keeper/grpc_query_test.go +++ b/x/oracle/keeper/grpc_query_test.go @@ -1,10 +1,12 @@ package keeper_test import ( + "fmt" "math/rand" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/tendermint/crypto/secp256k1" + "google.golang.org/grpc/codes" appparams "github.com/umee-network/umee/v3/app/params" "github.com/umee-network/umee/v3/x/oracle/keeper" @@ -222,6 +224,15 @@ func (s *IntegrationTestSuite) TestQuerier_Medians() { s.Require().Equal(res.Medians, sdk.NewDecCoins(atomMedian)) } +func (s *IntegrationTestSuite) TestQuerier_MediansOutOfRange() { + app, ctx := s.app, s.ctx + + app.OracleKeeper.SetMaximumMedianStamps(ctx, 10) + + _, err := s.queryClient.Medians(ctx.Context(), &types.QueryMedians{Denom: "atom", NumStamps: 11}) + s.Require().Errorf(err, fmt.Sprintf("%s numStamps must be less than %d", codes.OutOfRange, app.OracleKeeper.MaximumMedianStamps(ctx))) +} + func (s *IntegrationTestSuite) TestQuerier_MedianDeviations() { app, ctx := s.app, s.ctx From 482feab3616f372e1284b016234a27c3336905cb Mon Sep 17 00:00:00 2001 From: toteki <63419657+toteki@users.noreply.github.com> Date: Mon, 12 Dec 2022 11:27:06 -0700 Subject: [PATCH 6/9] field reorder + make proto-all --- proto/umee/oracle/v1/genesis.proto | 2 +- swagger/swagger.yaml | 149 ++++++++++++----------------- x/oracle/types/genesis.pb.go | 77 +++++++-------- 3 files changed, 99 insertions(+), 129 deletions(-) diff --git a/proto/umee/oracle/v1/genesis.proto b/proto/umee/oracle/v1/genesis.proto index b779fd5f0f..d3f1ab155c 100644 --- a/proto/umee/oracle/v1/genesis.proto +++ b/proto/umee/oracle/v1/genesis.proto @@ -22,8 +22,8 @@ message GenesisState { [(gogoproto.nullable) = false]; repeated AggregateExchangeRateVote aggregate_exchange_rate_votes = 6 [(gogoproto.nullable) = false]; - repeated Price historic_prices = 8 [(gogoproto.nullable) = false]; repeated Price medians = 7 [(gogoproto.nullable) = false]; + repeated Price historic_prices = 8 [(gogoproto.nullable) = false]; repeated Price medianDeviations = 9 [(gogoproto.nullable) = false]; } diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 030bcca106..81215af5df 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -1073,6 +1073,12 @@ paths: in: query required: false type: string + - name: numStamps + description: numStamps defines the number of median stamps to query for. + in: query + required: false + type: string + format: uint64 tags: - Query /umee/oracle/v1/denoms/active_exchange_rates: @@ -1233,54 +1239,41 @@ paths: format: uint64 min_valid_per_window: type: string - stamp_period: + historic_stamp_period: type: string format: uint64 description: >- - Stamp Period represents the amount of blocks the - historacle module + Historic Stamp Period represents the amount of blocks the + oracle - waits before recording a set of prices from the oracle. - prune_period: + module waits before recording a new historic price. + median_stamp_period: type: string format: uint64 description: >- - Prune Period represents the maximum amount of blocks which - we want + Median Stamp Period represents the amount blocks the + oracle module + + waits between calculating and stamping a new median and + standard - to keep a record of our set of exchange rates. - median_period: + deviation of that median. + maximum_price_stamps: type: string format: uint64 description: >- - Median Period represents the amount blocks we will wait - between + Maximum Price Stamps represents the maximum amount of + historic prices - calculating the median and standard deviation of the - median of - - historic prices in the last Prune Period. - historic_accept_list: - type: array - items: - type: object - properties: - base_denom: - type: string - symbol_denom: - type: string - exponent: - type: integer - format: int64 - title: Denom - the object to hold configurations of each denom + the oracle module will store before pruning via FIFO. + maximum_median_stamps: + type: string + format: uint64 description: >- - Historic Asset List is a list of assets which will use the - historic - - price stamping protection methodology (mainly - manipulatable assets). + Maximum Median Stamps represents the maximum amount of + medians the - Any assets not on this list will not be stamped. + oracle module will store before pruning via FIFO. description: >- QueryParamsResponse is the response type for the Query/Params RPC method. @@ -2716,42 +2709,31 @@ definitions: format: uint64 min_valid_per_window: type: string - stamp_period: + historic_stamp_period: type: string format: uint64 description: |- - Stamp Period represents the amount of blocks the historacle module - waits before recording a set of prices from the oracle. - prune_period: + Historic Stamp Period represents the amount of blocks the oracle + module waits before recording a new historic price. + median_stamp_period: type: string format: uint64 description: |- - Prune Period represents the maximum amount of blocks which we want - to keep a record of our set of exchange rates. - median_period: + Median Stamp Period represents the amount blocks the oracle module + waits between calculating and stamping a new median and standard + deviation of that median. + maximum_price_stamps: type: string format: uint64 description: |- - Median Period represents the amount blocks we will wait between - calculating the median and standard deviation of the median of - historic prices in the last Prune Period. - historic_accept_list: - type: array - items: - type: object - properties: - base_denom: - type: string - symbol_denom: - type: string - exponent: - type: integer - format: int64 - title: Denom - the object to hold configurations of each denom + Maximum Price Stamps represents the maximum amount of historic prices + the oracle module will store before pruning via FIFO. + maximum_median_stamps: + type: string + format: uint64 description: |- - Historic Asset List is a list of assets which will use the historic - price stamping protection methodology (mainly manipulatable assets). - Any assets not on this list will not be stamped. + Maximum Median Stamps represents the maximum amount of medians the + oracle module will store before pruning via FIFO. description: Params defines the parameters for the oracle module. umee.oracle.v1.QueryActiveExchangeRatesResponse: type: object @@ -3016,46 +2998,33 @@ definitions: format: uint64 min_valid_per_window: type: string - stamp_period: + historic_stamp_period: type: string format: uint64 description: |- - Stamp Period represents the amount of blocks the historacle module - waits before recording a set of prices from the oracle. - prune_period: + Historic Stamp Period represents the amount of blocks the oracle + module waits before recording a new historic price. + median_stamp_period: type: string format: uint64 description: |- - Prune Period represents the maximum amount of blocks which we want - to keep a record of our set of exchange rates. - median_period: + Median Stamp Period represents the amount blocks the oracle module + waits between calculating and stamping a new median and standard + deviation of that median. + maximum_price_stamps: type: string format: uint64 - description: |- - Median Period represents the amount blocks we will wait between - calculating the median and standard deviation of the median of - historic prices in the last Prune Period. - historic_accept_list: - type: array - items: - type: object - properties: - base_denom: - type: string - symbol_denom: - type: string - exponent: - type: integer - format: int64 - title: Denom - the object to hold configurations of each denom description: >- - Historic Asset List is a list of assets which will use the - historic - - price stamping protection methodology (mainly manipulatable - assets). + Maximum Price Stamps represents the maximum amount of historic + prices - Any assets not on this list will not be stamped. + the oracle module will store before pruning via FIFO. + maximum_median_stamps: + type: string + format: uint64 + description: |- + Maximum Median Stamps represents the maximum amount of medians the + oracle module will store before pruning via FIFO. description: QueryParamsResponse is the response type for the Query/Params RPC method. umee.oracle.v1.QuerySlashWindowResponse: type: object diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index 80da8d64d6..5c7ad64954 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -31,8 +31,8 @@ type GenesisState struct { MissCounters []MissCounter `protobuf:"bytes,4,rep,name=miss_counters,json=missCounters,proto3" json:"miss_counters"` AggregateExchangeRatePrevotes []AggregateExchangeRatePrevote `protobuf:"bytes,5,rep,name=aggregate_exchange_rate_prevotes,json=aggregateExchangeRatePrevotes,proto3" json:"aggregate_exchange_rate_prevotes"` AggregateExchangeRateVotes []AggregateExchangeRateVote `protobuf:"bytes,6,rep,name=aggregate_exchange_rate_votes,json=aggregateExchangeRateVotes,proto3" json:"aggregate_exchange_rate_votes"` - HistoricPrices []Price `protobuf:"bytes,8,rep,name=historic_prices,json=historicPrices,proto3" json:"historic_prices"` Medians []Price `protobuf:"bytes,7,rep,name=medians,proto3" json:"medians"` + HistoricPrices []Price `protobuf:"bytes,8,rep,name=historic_prices,json=historicPrices,proto3" json:"historic_prices"` MedianDeviations []Price `protobuf:"bytes,9,rep,name=medianDeviations,proto3" json:"medianDeviations"` } @@ -199,43 +199,44 @@ func init() { func init() { proto.RegisterFile("umee/oracle/v1/genesis.proto", fileDescriptor_c99b4af40468acc1) } var fileDescriptor_c99b4af40468acc1 = []byte{ - // 575 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x5b, 0x6e, 0xd3, 0x4c, - 0x14, 0x8e, 0x7b, 0x49, 0xdb, 0x49, 0x9b, 0x3f, 0x9d, 0x1f, 0x90, 0x95, 0x50, 0x37, 0x8d, 0x84, - 0x54, 0x04, 0xd8, 0x6a, 0x0b, 0x0b, 0x68, 0x08, 0xed, 0x0b, 0xa0, 0x2a, 0xdc, 0x24, 0x24, 0x64, - 0x4d, 0xec, 0x13, 0xc7, 0x6a, 0xec, 0xb1, 0x66, 0xc6, 0xa6, 0x08, 0x21, 0xb1, 0x04, 0xd6, 0xc1, - 0x4a, 0xf2, 0xd8, 0x47, 0x9e, 0xb8, 0x24, 0x1b, 0x41, 0x1e, 0x4f, 0x9a, 0xc4, 0x69, 0x69, 0xdf, - 0x9c, 0xf3, 0xdd, 0x4e, 0xe4, 0xef, 0x18, 0xdd, 0x8d, 0x03, 0x00, 0x8b, 0x32, 0xe2, 0xf4, 0xc1, - 0x4a, 0xf6, 0x2c, 0x0f, 0x42, 0xe0, 0x3e, 0x37, 0x23, 0x46, 0x05, 0xc5, 0xe5, 0x14, 0x35, 0x33, - 0xd4, 0x4c, 0xf6, 0xaa, 0xb7, 0x3c, 0xea, 0x51, 0x09, 0x59, 0xe9, 0x53, 0xc6, 0xaa, 0xd6, 0x72, - 0x1e, 0x8a, 0x2f, 0xc1, 0xc6, 0xd7, 0x22, 0x5a, 0x3f, 0xce, 0x4c, 0x5f, 0x09, 0x22, 0x00, 0x3f, - 0x46, 0xc5, 0x88, 0x30, 0x12, 0x70, 0x5d, 0xab, 0x6b, 0xbb, 0xa5, 0xfd, 0x3b, 0xe6, 0x6c, 0x88, - 0x79, 0x22, 0xd1, 0xe6, 0xd2, 0xe0, 0xe7, 0x76, 0xa1, 0xad, 0xb8, 0xf8, 0x0d, 0xc2, 0x5d, 0x00, - 0x17, 0x98, 0x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0xd9, 0xa9, - 0xfc, 0x61, 0x25, 0x07, 0xd6, 0xd9, 0xf8, 0x03, 0x25, 0x3e, 0x45, 0xc0, 0x3b, 0x45, 0xf9, 0x75, - 0x3a, 0xf8, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x07, 0x4b, 0xed, 0x08, 0x00, 0x05, 0x00, 0x00, + // 577 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xdd, 0x6e, 0xd3, 0x4c, + 0x14, 0x8c, 0xfb, 0x93, 0xb6, 0x9b, 0x36, 0x5f, 0xba, 0x1f, 0x20, 0x2b, 0xa1, 0x6e, 0x1a, 0x09, + 0xa9, 0x08, 0xb0, 0xd5, 0x16, 0x1e, 0xa0, 0x21, 0xb4, 0x37, 0x80, 0xaa, 0xf0, 0x27, 0x21, 0x21, + 0x6b, 0x63, 0x9f, 0x38, 0x56, 0x63, 0xaf, 0xb5, 0xbb, 0x36, 0x45, 0x08, 0x89, 0x47, 0xe0, 0x39, + 0x78, 0x92, 0x5c, 0xf6, 0x92, 0x2b, 0x7e, 0x92, 0x17, 0x41, 0x5e, 0x6f, 0x9a, 0xc4, 0x69, 0x69, + 0xef, 0x92, 0x33, 0x73, 0x66, 0x26, 0xca, 0x9c, 0x45, 0x77, 0xe3, 0x00, 0xc0, 0xa2, 0x8c, 0x38, + 0x7d, 0xb0, 0x92, 0x3d, 0xcb, 0x83, 0x10, 0xb8, 0xcf, 0xcd, 0x88, 0x51, 0x41, 0x71, 0x39, 0x45, + 0xcd, 0x0c, 0x35, 0x93, 0xbd, 0xea, 0x2d, 0x8f, 0x7a, 0x54, 0x42, 0x56, 0xfa, 0x29, 0x63, 0x55, + 0x6b, 0x39, 0x0d, 0xc5, 0x97, 0x60, 0xe3, 0x6b, 0x11, 0xad, 0x1f, 0x67, 0xa2, 0xaf, 0x04, 0x11, + 0x80, 0x1f, 0xa3, 0x62, 0x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 0xf9, 0xd0, + 0xd0, 0x7e, 0x0f, 0x0d, 0xed, 0xdb, 0xc8, 0x28, 0x9c, 0x8f, 0x8c, 0xc2, 0x8f, 0x91, 0x51, 0x78, + 0x6f, 0x7a, 0xbe, 0xe8, 0xc5, 0x1d, 0xd3, 0xa1, 0x81, 0x95, 0x06, 0x78, 0x14, 0x82, 0xf8, 0x48, + 0xd9, 0xa9, 0xfc, 0x62, 0x25, 0x07, 0xd6, 0xd9, 0xf8, 0x81, 0x12, 0x9f, 0x22, 0xe0, 0x9d, 0xa2, + 0x7c, 0x9d, 0x0e, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x25, 0xbb, 0xa8, 0x00, 0x05, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { From 732f6c23502bf01a430aef789c7009a70f1ea259 Mon Sep 17 00:00:00 2001 From: ryanbajollari <54822716+rbajollari@users.noreply.github.com> Date: Mon, 12 Dec 2022 19:14:41 -0500 Subject: [PATCH 7/9] Update proto/umee/oracle/v1/query.proto Co-authored-by: Robert Zaremba --- proto/umee/oracle/v1/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/umee/oracle/v1/query.proto b/proto/umee/oracle/v1/query.proto index ac06a2964f..7911adf8b6 100644 --- a/proto/umee/oracle/v1/query.proto +++ b/proto/umee/oracle/v1/query.proto @@ -253,7 +253,7 @@ message QueryMedians { // denom defines the denomination to query for. string denom = 1; // numStamps defines the number of median stamps to query for. - uint64 numStamps = 2; + uint32 numStamps = 2; } // QueryMediansResponse is response type for the From 2354b6a009d558131bfcbf249359161b04733334 Mon Sep 17 00:00:00 2001 From: rbajollari Date: Tue, 13 Dec 2022 09:45:23 -0500 Subject: [PATCH 8/9] PR comments --- proto/umee/oracle/v1/query.proto | 3 +- swagger/swagger.yaml | 10 +++-- x/oracle/keeper/grpc_query.go | 24 +++++----- x/oracle/keeper/grpc_query_test.go | 38 +++++++++------- x/oracle/types/query.pb.go | 72 +++++++++++++++--------------- 5 files changed, 81 insertions(+), 66 deletions(-) diff --git a/proto/umee/oracle/v1/query.proto b/proto/umee/oracle/v1/query.proto index 7911adf8b6..682d233f7f 100644 --- a/proto/umee/oracle/v1/query.proto +++ b/proto/umee/oracle/v1/query.proto @@ -252,7 +252,8 @@ message QueryMedians { option (gogoproto.goproto_getters) = false; // denom defines the denomination to query for. string denom = 1; - // numStamps defines the number of median stamps to query for. + // numStamps defines the number of median stamps to query for. numStamps + // must be greater than 0. uint32 numStamps = 2; } diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 81215af5df..bcbac66698 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -1074,11 +1074,15 @@ paths: required: false type: string - name: numStamps - description: numStamps defines the number of median stamps to query for. + description: >- + numStamps defines the number of median stamps to query for. + numStamps + + must be greater than 0. in: query required: false - type: string - format: uint64 + type: integer + format: int64 tags: - Query /umee/oracle/v1/denoms/active_exchange_rates: diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index d211f450d5..659b7cdb33 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" @@ -263,21 +262,26 @@ func (q querier) Medians( ctx := sdk.UnwrapSDKContext(goCtx) - if req.NumStamps > q.MaximumMedianStamps(ctx) { - return nil, status.Error(codes.OutOfRange, fmt.Sprintf("numStamps must be less than %d", q.MaximumMedianStamps(ctx))) - } - - var medians sdk.DecCoins + medians := make([]sdk.DecCoin, 0) if len(req.Denom) > 0 { - medianList := q.HistoricMedians(ctx, req.Denom, req.NumStamps) + if req.NumStamps == 0 { + return nil, status.Error(codes.InvalidArgument, "parameter NumStamps must be greater than 0") + } + + if req.NumStamps > uint32(q.MaximumMedianStamps(ctx)) { + req.NumStamps = uint32(q.MaximumMedianStamps(ctx)) + } + + medians = make(sdk.DecCoins, req.NumStamps) + medianList := q.HistoricMedians(ctx, req.Denom, uint64(req.NumStamps)) - for _, median := range medianList { - medians = medians.Add(sdk.NewDecCoinFromDec(req.Denom, median)) + for i, median := range medianList { + medians[i] = sdk.NewDecCoinFromDec(req.Denom, median) } } else { q.IterateAllMedianPrices(ctx, func(median types.Price) (stop bool) { - medians = medians.Add(sdk.NewDecCoinFromDec(median.ExchangeRateTuple.Denom, median.ExchangeRateTuple.ExchangeRate)) + medians = append(medians, sdk.NewDecCoinFromDec(median.ExchangeRateTuple.Denom, median.ExchangeRateTuple.ExchangeRate)) return false }) } diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go index 0763571792..d9b07f3cfe 100644 --- a/x/oracle/keeper/grpc_query_test.go +++ b/x/oracle/keeper/grpc_query_test.go @@ -1,12 +1,10 @@ package keeper_test import ( - "fmt" "math/rand" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/tendermint/crypto/secp256k1" - "google.golang.org/grpc/codes" appparams "github.com/umee-network/umee/v3/app/params" "github.com/umee-network/umee/v3/x/oracle/keeper" @@ -207,30 +205,36 @@ func (s *IntegrationTestSuite) TestQuerier_AggregateVotesAppendVotes() { func (s *IntegrationTestSuite) TestQuerier_Medians() { app, ctx := s.app, s.ctx - atomMedian := sdk.DecCoin{Denom: "atom", Amount: sdk.MustNewDecFromStr("49.99")} - umeeMedian := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} + atomMedian0 := sdk.DecCoin{Denom: "atom", Amount: sdk.MustNewDecFromStr("49.99")} + umeeMedian0 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6541.48")} + atomMedian1 := sdk.DecCoin{Denom: "atom", Amount: sdk.MustNewDecFromStr("51.09")} + umeeMedian1 := sdk.DecCoin{Denom: "umee", Amount: sdk.MustNewDecFromStr("6540.23")} - app.OracleKeeper.SetMedianStampPeriod(ctx, 1) - app.OracleKeeper.SetHistoricMedian(ctx, atomMedian.Denom, uint64(ctx.BlockHeight()-1), atomMedian.Amount) - app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian.Denom, uint64(ctx.BlockHeight()-1), umeeMedian.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, atomMedian0.Denom, uint64(ctx.BlockHeight()-4), atomMedian0.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian0.Denom, uint64(ctx.BlockHeight()-4), umeeMedian0.Amount) res, err := s.queryClient.Medians(ctx.Context(), &types.QueryMedians{}) s.Require().NoError(err) - s.Require().Equal(res.Medians, sdk.NewDecCoins(atomMedian, umeeMedian)) - - res, err = s.queryClient.Medians(ctx.Context(), &types.QueryMedians{Denom: atomMedian.Denom, NumStamps: 1}) + s.Require().Equal(res.Medians, sdk.NewDecCoins(atomMedian0, umeeMedian0)) + res, err = s.queryClient.Medians(ctx.Context(), &types.QueryMedians{Denom: atomMedian0.Denom, NumStamps: 1}) s.Require().NoError(err) - s.Require().Equal(res.Medians, sdk.NewDecCoins(atomMedian)) -} + s.Require().Equal(res.Medians, sdk.NewDecCoins(atomMedian0)) -func (s *IntegrationTestSuite) TestQuerier_MediansOutOfRange() { - app, ctx := s.app, s.ctx + app.OracleKeeper.SetHistoricMedian(ctx, atomMedian1.Denom, uint64(ctx.BlockHeight()-2), atomMedian1.Amount) + app.OracleKeeper.SetHistoricMedian(ctx, umeeMedian1.Denom, uint64(ctx.BlockHeight()-2), umeeMedian1.Amount) - app.OracleKeeper.SetMaximumMedianStamps(ctx, 10) + res, err = s.queryClient.Medians(ctx.Context(), &types.QueryMedians{}) + s.Require().NoError(err) + s.Require().Equal(res.Medians, sdk.DecCoins{atomMedian0, atomMedian1, umeeMedian0, umeeMedian1}) + + res, err = s.queryClient.Medians(ctx.Context(), &types.QueryMedians{Denom: atomMedian1.Denom, NumStamps: 2}) + s.Require().NoError(err) + s.Require().Equal(res.Medians, sdk.DecCoins{atomMedian1, atomMedian0}) - _, err := s.queryClient.Medians(ctx.Context(), &types.QueryMedians{Denom: "atom", NumStamps: 11}) - s.Require().Errorf(err, fmt.Sprintf("%s numStamps must be less than %d", codes.OutOfRange, app.OracleKeeper.MaximumMedianStamps(ctx))) + res, err = s.queryClient.Medians(ctx.Context(), &types.QueryMedians{Denom: atomMedian1.Denom, NumStamps: 0}) + s.Require().ErrorContains(err, "parameter NumStamps must be greater than 0") + s.Require().Nil(res) } func (s *IntegrationTestSuite) TestQuerier_MedianDeviations() { diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 31096c84d9..e767599e77 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -830,8 +830,9 @@ var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo type QueryMedians struct { // denom defines the denomination to query for. Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - // numStamps defines the number of median stamps to query for. - NumStamps uint64 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` + // numStamps defines the number of median stamps to query for. numStamps + // must be greater than 0. + NumStamps uint32 `protobuf:"varint,2,opt,name=numStamps,proto3" json:"numStamps,omitempty"` } func (m *QueryMedians) Reset() { *m = QueryMedians{} } @@ -1016,7 +1017,7 @@ func init() { func init() { proto.RegisterFile("umee/oracle/v1/query.proto", fileDescriptor_710e319bc1815d33) } var fileDescriptor_710e319bc1815d33 = []byte{ - // 1151 bytes of a gzipped FileDescriptorProto + // 1153 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0xcf, 0x6f, 0x1b, 0x45, 0x14, 0xc7, 0xbd, 0xa5, 0x4d, 0xc9, 0x73, 0xed, 0x3a, 0xd3, 0x34, 0xb2, 0x36, 0xc1, 0x09, 0xdb, 0x14, 0x42, 0x9a, 0xec, 0x36, 0x4e, 0x10, 0x28, 0xa2, 0x82, 0xfc, 0x42, 0x48, 0x14, 0x29, 0xb8, @@ -1058,37 +1059,38 @@ var fileDescriptor_710e319bc1815d33 = []byte{ 0x4d, 0x67, 0xa4, 0x17, 0xc6, 0x29, 0xe2, 0xb8, 0x70, 0x01, 0xf2, 0x5c, 0x78, 0x1d, 0xfb, 0xd8, 0x65, 0xc6, 0xc7, 0x12, 0x4f, 0x7c, 0x54, 0xfa, 0x0b, 0x30, 0xd0, 0xe2, 0x11, 0x39, 0x85, 0x91, 0xa4, 0xac, 0xa8, 0x97, 0x1a, 0xb2, 0xd6, 0xb8, 0x0f, 0xd7, 0xc4, 0x69, 0x25, 0xb6, 0x83, 0xbd, - 0x2e, 0x57, 0x35, 0x1a, 0x83, 0x41, 0x6f, 0xd7, 0x7d, 0x10, 0x60, 0xb7, 0xc5, 0xca, 0x97, 0xf8, - 0xf1, 0x3a, 0x0b, 0x44, 0x9e, 0xd7, 0x23, 0x0d, 0x86, 0xa3, 0xed, 0x14, 0xdc, 0x36, 0x5c, 0x75, - 0x45, 0xe8, 0xe5, 0xdd, 0xdd, 0x1d, 0x05, 0xe3, 0x1d, 0x79, 0xd2, 0x05, 0xc4, 0x2a, 0x69, 0x3b, - 0xc2, 0xe0, 0x7a, 0xfa, 0xd0, 0x93, 0xce, 0xc1, 0x4e, 0xae, 0x54, 0xfb, 0x38, 0x84, 0x92, 0x9b, - 0xc8, 0xbd, 0xbc, 0x0d, 0xa5, 0xa4, 0xaa, 0xbf, 0x14, 0xe1, 0x0a, 0x07, 0x44, 0x47, 0x1a, 0x14, - 0xe2, 0x26, 0x6b, 0x24, 0x9f, 0x77, 0xda, 0x51, 0xf5, 0xe9, 0xde, 0x35, 0x9d, 0xad, 0x1a, 0x6f, - 0x7f, 0xf7, 0xc7, 0x7f, 0x8f, 0x2f, 0x59, 0x68, 0xd6, 0x4a, 0x7c, 0x21, 0xe0, 0x53, 0x63, 0x56, - 0xdc, 0x92, 0xad, 0x87, 0x3c, 0x7c, 0x88, 0x7e, 0xd5, 0xe0, 0x46, 0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0x5b, 0xe7, 0x24, 0x95, 0x7e, 0x85, 0xeb, 0x97, 0xd1, 0x48, 0x52, 0x5f, + 0x58, 0x37, 0x3a, 0x80, 0xab, 0x1d, 0xd7, 0x1e, 0xcb, 0x3e, 0xf1, 0x22, 0xab, 0x4f, 0x9e, 0x97, + 0x55, 0x72, 0xd3, 0x5c, 0x6e, 0x12, 0x19, 0x42, 0x6e, 0xcb, 0x61, 0x41, 0xea, 0x22, 0x95, 0x0e, + 0x8b, 0x9e, 0x68, 0x50, 0x4a, 0xb9, 0xeb, 0xed, 0x73, 0x64, 0xce, 0xca, 0xba, 0x1c, 0xbe, 0x6e, + 0x8e, 0x9b, 0xbc, 0xdb, 0xcf, 0xc1, 0xaa, 0xdb, 0x6a, 0xf5, 0xf2, 0xfd, 0xe3, 0x7f, 0x2b, 0xb9, + 0xe3, 0x93, 0x8a, 0xf6, 0xec, 0xa4, 0xa2, 0xfd, 0x73, 0x52, 0xd1, 0x7e, 0x38, 0xad, 0xe4, 0x9e, + 0x9d, 0x56, 0x72, 0x7f, 0x9e, 0x56, 0x72, 0x5f, 0x98, 0x11, 0x17, 0x0e, 0xbb, 0xce, 0x7a, 0x24, + 0xd8, 0xa3, 0xfe, 0xb6, 0x90, 0x68, 0xcf, 0x5b, 0xfb, 0x9d, 0x69, 0x73, 0x47, 0xde, 0x1c, 0xe0, + 0x3f, 0x6e, 0xe7, 0x9f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x02, 0x1f, 0x38, 0x1a, 0x7b, 0x0f, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -4183,7 +4185,7 @@ func (m *QueryMedians) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumStamps |= uint64(b&0x7F) << shift + m.NumStamps |= uint32(b&0x7F) << shift if b < 0x80 { break } From 3cc042f21adcb1cf3d998ac15789e9c3022158e6 Mon Sep 17 00:00:00 2001 From: rbajollari Date: Tue, 13 Dec 2022 09:56:50 -0500 Subject: [PATCH 9/9] lint --- x/oracle/keeper/grpc_query.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 659b7cdb33..99eac89c14 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -281,7 +281,10 @@ func (q querier) Medians( } } else { q.IterateAllMedianPrices(ctx, func(median types.Price) (stop bool) { - medians = append(medians, sdk.NewDecCoinFromDec(median.ExchangeRateTuple.Denom, median.ExchangeRateTuple.ExchangeRate)) + medians = append( + medians, + sdk.NewDecCoinFromDec(median.ExchangeRateTuple.Denom, median.ExchangeRateTuple.ExchangeRate), + ) return false }) }