diff --git a/proto/stride/stakeibc/query.proto b/proto/stride/stakeibc/query.proto index feb50668e3..ed942eebe4 100644 --- a/proto/stride/stakeibc/query.proto +++ b/proto/stride/stakeibc/query.proto @@ -9,6 +9,7 @@ import "stride/stakeibc/validator.proto"; import "stride/stakeibc/host_zone.proto"; import "stride/stakeibc/epoch_tracker.proto"; import "stride/stakeibc/address_unbonding.proto"; +import "stride/stakeibc/trade_route.proto"; option go_package = "github.com/Stride-Labs/stride/v16/x/stakeibc/types"; @@ -73,6 +74,12 @@ service Query { option (google.api.http).get = "/Stride-Labs/stride/stakeibc/unbondings/{address}"; } + + // Queries all trade routes + rpc AllTradeRoutes(QueryAllTradeRoutes) + returns (QueryAllTradeRoutesResponse) { + option (google.api.http).get = "/Stride-Labs/stride/stakeibc/trade_routes"; + } } // QueryInterchainAccountFromAddressRequest is the request type for the @@ -146,3 +153,9 @@ message QueryAddressUnbondingsResponse { repeated AddressUnbonding address_unbondings = 1 [ (gogoproto.nullable) = false ]; } + +message QueryAllTradeRoutes {}; + +message QueryAllTradeRoutesResponse { + repeated TradeRoute trade_routes = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/x/stakeibc/client/cli/query.go b/x/stakeibc/client/cli/query.go index 0d687a6029..cd89779275 100644 --- a/x/stakeibc/client/cli/query.go +++ b/x/stakeibc/client/cli/query.go @@ -29,6 +29,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdListEpochTracker()) cmd.AddCommand(CmdShowEpochTracker()) cmd.AddCommand(CmdNextPacketSequence()) + cmd.AddCommand(CmdListTradeRoutes()) return cmd } diff --git a/x/stakeibc/client/cli/query_trade_routes.go b/x/stakeibc/client/cli/query_trade_routes.go new file mode 100644 index 0000000000..6c370d9177 --- /dev/null +++ b/x/stakeibc/client/cli/query_trade_routes.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/Stride-Labs/stride/v16/x/stakeibc/types" +) + +func CmdListTradeRoutes() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-trade-routes", + Short: "list all trade routes", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllTradeRoutes{} + res, err := queryClient.AllTradeRoutes(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stakeibc/keeper/grpc_query_trade_routes.go b/x/stakeibc/keeper/grpc_query_trade_routes.go new file mode 100644 index 0000000000..5bccce8b4d --- /dev/null +++ b/x/stakeibc/keeper/grpc_query_trade_routes.go @@ -0,0 +1,23 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/Stride-Labs/stride/v16/x/stakeibc/types" +) + +func (k Keeper) AllTradeRoutes(c context.Context, req *types.QueryAllTradeRoutes) (*types.QueryAllTradeRoutesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + routes := k.GetAllTradeRoutes(ctx) + + return &types.QueryAllTradeRoutesResponse{TradeRoutes: routes}, nil +} diff --git a/x/stakeibc/keeper/reward_converter.go b/x/stakeibc/keeper/reward_converter.go index 1331b070cf..1bfc9cc855 100644 --- a/x/stakeibc/keeper/reward_converter.go +++ b/x/stakeibc/keeper/reward_converter.go @@ -435,6 +435,7 @@ func (k Keeper) SwapAllRewardTokens(ctx sdk.Context) { // Helper function to be run hourly, kicks off query to get and update the swap price in keeper data func (k Keeper) UpdateAllSwapPrices(ctx sdk.Context) { + k.SetTradeRoute(ctx, types.TradeRoute{RewardDenomOnHostZone: "A", TargetDenomOnHostZone: "B"}) for _, route := range k.GetAllTradeRoutes(ctx) { // ICQ swap price for the specific pair on this route and update keeper on callback k.PoolSpotPriceQuery(ctx, route) diff --git a/x/stakeibc/types/query.pb.go b/x/stakeibc/types/query.pb.go index e7ba7beffd..4ebacfb2da 100644 --- a/x/stakeibc/types/query.pb.go +++ b/x/stakeibc/types/query.pb.go @@ -931,6 +931,86 @@ func (m *QueryAddressUnbondingsResponse) GetAddressUnbondings() []AddressUnbondi return nil } +type QueryAllTradeRoutes struct { +} + +func (m *QueryAllTradeRoutes) Reset() { *m = QueryAllTradeRoutes{} } +func (m *QueryAllTradeRoutes) String() string { return proto.CompactTextString(m) } +func (*QueryAllTradeRoutes) ProtoMessage() {} +func (*QueryAllTradeRoutes) Descriptor() ([]byte, []int) { + return fileDescriptor_494b786fe66f2b80, []int{20} +} +func (m *QueryAllTradeRoutes) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllTradeRoutes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllTradeRoutes.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 *QueryAllTradeRoutes) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllTradeRoutes.Merge(m, src) +} +func (m *QueryAllTradeRoutes) XXX_Size() int { + return m.Size() +} +func (m *QueryAllTradeRoutes) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllTradeRoutes.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllTradeRoutes proto.InternalMessageInfo + +type QueryAllTradeRoutesResponse struct { + TradeRoutes []TradeRoute `protobuf:"bytes,1,rep,name=trade_routes,json=tradeRoutes,proto3" json:"trade_routes"` +} + +func (m *QueryAllTradeRoutesResponse) Reset() { *m = QueryAllTradeRoutesResponse{} } +func (m *QueryAllTradeRoutesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllTradeRoutesResponse) ProtoMessage() {} +func (*QueryAllTradeRoutesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_494b786fe66f2b80, []int{21} +} +func (m *QueryAllTradeRoutesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllTradeRoutesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllTradeRoutesResponse.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 *QueryAllTradeRoutesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllTradeRoutesResponse.Merge(m, src) +} +func (m *QueryAllTradeRoutesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllTradeRoutesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllTradeRoutesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllTradeRoutesResponse proto.InternalMessageInfo + +func (m *QueryAllTradeRoutesResponse) GetTradeRoutes() []TradeRoute { + if m != nil { + return m.TradeRoutes + } + return nil +} + func init() { proto.RegisterType((*QueryInterchainAccountFromAddressRequest)(nil), "stride.stakeibc.QueryInterchainAccountFromAddressRequest") proto.RegisterType((*QueryInterchainAccountFromAddressResponse)(nil), "stride.stakeibc.QueryInterchainAccountFromAddressResponse") @@ -952,85 +1032,92 @@ func init() { proto.RegisterType((*QueryGetNextPacketSequenceResponse)(nil), "stride.stakeibc.QueryGetNextPacketSequenceResponse") proto.RegisterType((*QueryAddressUnbondings)(nil), "stride.stakeibc.QueryAddressUnbondings") proto.RegisterType((*QueryAddressUnbondingsResponse)(nil), "stride.stakeibc.QueryAddressUnbondingsResponse") + proto.RegisterType((*QueryAllTradeRoutes)(nil), "stride.stakeibc.QueryAllTradeRoutes") + proto.RegisterType((*QueryAllTradeRoutesResponse)(nil), "stride.stakeibc.QueryAllTradeRoutesResponse") } func init() { proto.RegisterFile("stride/stakeibc/query.proto", fileDescriptor_494b786fe66f2b80) } var fileDescriptor_494b786fe66f2b80 = []byte{ - // 1158 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x97, 0xdd, 0x6e, 0x1b, 0x45, - 0x1b, 0xc7, 0xb3, 0x4d, 0x9a, 0x8f, 0x27, 0x89, 0xf2, 0x76, 0xde, 0x88, 0x38, 0xdb, 0xc4, 0x21, - 0xd3, 0xd2, 0x7c, 0x90, 0x7a, 0x89, 0x53, 0x2a, 0x35, 0xa2, 0x82, 0x44, 0x6a, 0x1b, 0xa3, 0x80, - 0x82, 0x0b, 0x15, 0x2a, 0x07, 0xd6, 0x78, 0x77, 0xb0, 0x57, 0x5d, 0xcf, 0xb8, 0xbb, 0xeb, 0x90, - 0x10, 0x59, 0x95, 0xb8, 0x82, 0x0a, 0xc4, 0x09, 0x67, 0x45, 0x1c, 0x70, 0xcc, 0x55, 0xf4, 0x8c, - 0x4a, 0x9c, 0x70, 0x14, 0xa1, 0x84, 0x2b, 0xa8, 0xb8, 0x00, 0xb4, 0x33, 0xb3, 0x6b, 0x7b, 0x3f, - 0x8c, 0xd3, 0x33, 0xcf, 0xcc, 0xf3, 0xf1, 0x9b, 0x67, 0x9e, 0xf9, 0xcf, 0x1a, 0xae, 0x7a, 0xbe, - 0x6b, 0x5b, 0xd4, 0xf0, 0x7c, 0xf2, 0x84, 0xda, 0x55, 0xd3, 0x78, 0xda, 0xa2, 0xee, 0x71, 0xa1, - 0xe9, 0x72, 0x9f, 0xa3, 0x19, 0xb9, 0x58, 0x08, 0x17, 0xf5, 0xd9, 0x1a, 0xaf, 0x71, 0xb1, 0x66, - 0x04, 0xbf, 0xa4, 0x99, 0xbe, 0x50, 0xe3, 0xbc, 0xe6, 0x50, 0x83, 0x34, 0x6d, 0x83, 0x30, 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9, 0x57, 0x67, 0x25, - 0xa3, 0x94, 0x71, 0x43, 0xdd, 0x18, 0xd0, 0xf0, 0x82, 0x52, 0xd5, 0x79, 0xae, 0x8c, 0x13, 0x75, - 0xe9, 0xda, 0xbb, 0xfb, 0x2f, 0xcf, 0xf2, 0xda, 0xab, 0xb3, 0xbc, 0xf6, 0xd7, 0x59, 0x5e, 0x7b, - 0x7e, 0x9e, 0x1f, 0x7a, 0x75, 0x9e, 0x1f, 0xfa, 0xf3, 0x3c, 0x3f, 0xf4, 0xb8, 0x58, 0xb3, 0xfd, - 0x7a, 0xab, 0x5a, 0x30, 0x79, 0x23, 0x2d, 0xec, 0xe1, 0xe6, 0x6d, 0xe3, 0xa8, 0x13, 0xdc, 0x3f, - 0x6e, 0x52, 0xaf, 0x3a, 0x2a, 0xfe, 0x59, 0x6d, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xb0, - 0x27, 0x34, 0x97, 0x0e, 0x00, 0x00, + // 1239 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x97, 0x4d, 0x6f, 0x1b, 0x45, + 0x18, 0xc7, 0xb3, 0x6d, 0x9a, 0xa6, 0x4f, 0xd2, 0x86, 0x0e, 0x81, 0x38, 0x9b, 0xc4, 0x21, 0xd3, + 0xd0, 0xbc, 0x34, 0xf5, 0x12, 0xa7, 0x54, 0x6a, 0x44, 0x05, 0x8e, 0x68, 0x1b, 0xa3, 0x80, 0x82, + 0x5b, 0x2a, 0x54, 0x0e, 0xd6, 0x78, 0x77, 0xb0, 0x57, 0x5d, 0xef, 0xb8, 0xbb, 0xe3, 0x90, 0x10, + 0x59, 0x95, 0xf8, 0x00, 0xa8, 0x02, 0x21, 0x24, 0x6e, 0x45, 0x1c, 0x38, 0xf3, 0x29, 0x7a, 0xa3, + 0x12, 0x17, 0x4e, 0x11, 0x4a, 0xf8, 0x04, 0xfd, 0x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0x79, + 0xe5, 0xd9, 0x49, 0x7e, 0xe8, 0xe5, 0x49, 0x7e, 0xe8, 0xef, 0x93, 0xfc, 0xd0, 0xa3, 0x62, 0xdd, + 0xe4, 0x8d, 0x76, 0xad, 0xa0, 0xb3, 0x66, 0x5a, 0xb8, 0xbd, 0xf5, 0x9b, 0xda, 0x7e, 0x24, 0xe8, + 0x41, 0x8b, 0xba, 0xb5, 0x11, 0xf1, 0x7f, 0x73, 0xe3, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa1, + 0xba, 0x20, 0x28, 0xd0, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1066,6 +1153,8 @@ type QueryClient interface { NextPacketSequence(ctx context.Context, in *QueryGetNextPacketSequenceRequest, opts ...grpc.CallOption) (*QueryGetNextPacketSequenceResponse, error) // Queries an address's unbondings AddressUnbondings(ctx context.Context, in *QueryAddressUnbondings, opts ...grpc.CallOption) (*QueryAddressUnbondingsResponse, error) + // Queries all trade routes + AllTradeRoutes(ctx context.Context, in *QueryAllTradeRoutes, opts ...grpc.CallOption) (*QueryAllTradeRoutesResponse, error) } type queryClient struct { @@ -1166,6 +1255,15 @@ func (c *queryClient) AddressUnbondings(ctx context.Context, in *QueryAddressUnb return out, nil } +func (c *queryClient) AllTradeRoutes(ctx context.Context, in *QueryAllTradeRoutes, opts ...grpc.CallOption) (*QueryAllTradeRoutesResponse, error) { + out := new(QueryAllTradeRoutesResponse) + err := c.cc.Invoke(ctx, "/stride.stakeibc.Query/AllTradeRoutes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -1189,6 +1287,8 @@ type QueryServer interface { NextPacketSequence(context.Context, *QueryGetNextPacketSequenceRequest) (*QueryGetNextPacketSequenceResponse, error) // Queries an address's unbondings AddressUnbondings(context.Context, *QueryAddressUnbondings) (*QueryAddressUnbondingsResponse, error) + // Queries all trade routes + AllTradeRoutes(context.Context, *QueryAllTradeRoutes) (*QueryAllTradeRoutesResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1225,6 +1325,9 @@ func (*UnimplementedQueryServer) NextPacketSequence(ctx context.Context, req *Qu func (*UnimplementedQueryServer) AddressUnbondings(ctx context.Context, req *QueryAddressUnbondings) (*QueryAddressUnbondingsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddressUnbondings not implemented") } +func (*UnimplementedQueryServer) AllTradeRoutes(ctx context.Context, req *QueryAllTradeRoutes) (*QueryAllTradeRoutesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllTradeRoutes not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1410,6 +1513,24 @@ func _Query_AddressUnbondings_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_AllTradeRoutes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllTradeRoutes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllTradeRoutes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stride.stakeibc.Query/AllTradeRoutes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllTradeRoutes(ctx, req.(*QueryAllTradeRoutes)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "stride.stakeibc.Query", HandlerType: (*QueryServer)(nil), @@ -1454,6 +1575,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AddressUnbondings", Handler: _Query_AddressUnbondings_Handler, }, + { + MethodName: "AllTradeRoutes", + Handler: _Query_AllTradeRoutes_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "stride/stakeibc/query.proto", @@ -2111,6 +2236,66 @@ func (m *QueryAddressUnbondingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryAllTradeRoutes) 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 *QueryAllTradeRoutes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllTradeRoutes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryAllTradeRoutesResponse) 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 *QueryAllTradeRoutesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllTradeRoutesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TradeRoutes) > 0 { + for iNdEx := len(m.TradeRoutes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TradeRoutes[iNdEx].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 @@ -2387,6 +2572,30 @@ func (m *QueryAddressUnbondingsResponse) Size() (n int) { return n } +func (m *QueryAllTradeRoutes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAllTradeRoutesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.TradeRoutes) > 0 { + for _, e := range m.TradeRoutes { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4071,6 +4280,140 @@ func (m *QueryAddressUnbondingsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAllTradeRoutes) 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: QueryAllTradeRoutes: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllTradeRoutes: 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 *QueryAllTradeRoutesResponse) 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: QueryAllTradeRoutesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllTradeRoutesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TradeRoutes", 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.TradeRoutes = append(m.TradeRoutes, TradeRoute{}) + if err := m.TradeRoutes[len(m.TradeRoutes)-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 skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/stakeibc/types/query.pb.gw.go b/x/stakeibc/types/query.pb.gw.go index 9f8b481472..09aeee14b9 100644 --- a/x/stakeibc/types/query.pb.gw.go +++ b/x/stakeibc/types/query.pb.gw.go @@ -451,6 +451,24 @@ func local_request_Query_AddressUnbondings_0(ctx context.Context, marshaler runt } +func request_Query_AllTradeRoutes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllTradeRoutes + var metadata runtime.ServerMetadata + + msg, err := client.AllTradeRoutes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllTradeRoutes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllTradeRoutes + var metadata runtime.ServerMetadata + + msg, err := server.AllTradeRoutes(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. @@ -664,6 +682,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AllTradeRoutes_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_AllTradeRoutes_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_AllTradeRoutes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -885,6 +926,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AllTradeRoutes_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_AllTradeRoutes_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_AllTradeRoutes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -906,6 +967,8 @@ var ( pattern_Query_NextPacketSequence_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"Stride-Labs", "stride", "stakeibc", "next_packet_sequence", "channel_id", "port_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AddressUnbondings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"Stride-Labs", "stride", "stakeibc", "unbondings", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllTradeRoutes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"Stride-Labs", "stride", "stakeibc", "trade_routes"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -926,4 +989,6 @@ var ( forward_Query_NextPacketSequence_0 = runtime.ForwardResponseMessage forward_Query_AddressUnbondings_0 = runtime.ForwardResponseMessage + + forward_Query_AllTradeRoutes_0 = runtime.ForwardResponseMessage )