From 7b61f15445e857ee1bc4497a48c0fd696e4bbb5b Mon Sep 17 00:00:00 2001 From: Amit Yadav Date: Tue, 3 Dec 2024 09:01:17 +0530 Subject: [PATCH 1/3] [Tier]: Add query for locked order balances (#1007) * add locked total query * restore --- proto/elys/tier/query.proto | 16 + x/tier/client/cli/query.go | 2 + x/tier/client/cli/query_get_locked_order.go | 45 ++ x/tier/keeper/query_locked_order.go | 24 + x/tier/types/query.pb.go | 566 ++++++++++++++++---- x/tier/types/query.pb.gw.go | 101 ++++ 6 files changed, 659 insertions(+), 95 deletions(-) create mode 100644 x/tier/client/cli/query_get_locked_order.go create mode 100644 x/tier/keeper/query_locked_order.go diff --git a/proto/elys/tier/query.proto b/proto/elys/tier/query.proto index 9c088ad29..253da3546 100644 --- a/proto/elys/tier/query.proto +++ b/proto/elys/tier/query.proto @@ -68,6 +68,12 @@ service Query { "/elys-network/elys/tier/liquid_total/{user}"; } + // Queries a list of LockedOrder items. + rpc LockedOrder(QueryLockedOrderRequest) returns (QueryLockedOrderResponse) { + option (google.api.http).get = + "/elys-network/elys/tier/locked_order/{user}"; + } + // Queries a list of GetAmmPrice items. rpc GetAmmPrice(QueryGetAmmPriceRequest) returns (QueryGetAmmPriceResponse) { option (google.api.http).get = @@ -183,6 +189,16 @@ message QueryLiquidTotalResponse { ]; } +message QueryLockedOrderRequest { string user = 1; } + +message QueryLockedOrderResponse { + string total = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + message QueryGetAmmPriceRequest { string denom = 1; int32 decimal = 2; diff --git a/x/tier/client/cli/query.go b/x/tier/client/cli/query.go index c39b7c785..5424c678d 100644 --- a/x/tier/client/cli/query.go +++ b/x/tier/client/cli/query.go @@ -47,6 +47,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdGetUsersPoolData()) + cmd.AddCommand(CmdLockedOrder()) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/tier/client/cli/query_get_locked_order.go b/x/tier/client/cli/query_get_locked_order.go new file mode 100644 index 000000000..10159e13f --- /dev/null +++ b/x/tier/client/cli/query_get_locked_order.go @@ -0,0 +1,45 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/elys-network/elys/x/tier/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdLockedOrder() *cobra.Command { + cmd := &cobra.Command{ + Use: "locked-order [user]", + Short: "Query locked-order", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + reqUser := args[0] + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryLockedOrderRequest{ + User: reqUser, + } + + res, err := queryClient.LockedOrder(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/tier/keeper/query_locked_order.go b/x/tier/keeper/query_locked_order.go new file mode 100644 index 000000000..7aff2bf5e --- /dev/null +++ b/x/tier/keeper/query_locked_order.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/elys-network/elys/x/tier/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) LockedOrder(goCtx context.Context, req *types.QueryLockedOrderRequest) (*types.QueryLockedOrderResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + sender := sdk.MustAccAddressFromBech32(req.User) + total := k.RetrieveTradeshieldTotal(ctx, sender) + + return &types.QueryLockedOrderResponse{ + Total: total, + }, nil +} diff --git a/x/tier/types/query.pb.go b/x/tier/types/query.pb.go index 65ae543bd..b166cf8e1 100644 --- a/x/tier/types/query.pb.go +++ b/x/tier/types/query.pb.go @@ -802,6 +802,87 @@ func (m *QueryLiquidTotalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryLiquidTotalResponse proto.InternalMessageInfo +type QueryLockedOrderRequest struct { + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` +} + +func (m *QueryLockedOrderRequest) Reset() { *m = QueryLockedOrderRequest{} } +func (m *QueryLockedOrderRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLockedOrderRequest) ProtoMessage() {} +func (*QueryLockedOrderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_461504ebf74c9a97, []int{18} +} +func (m *QueryLockedOrderRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLockedOrderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLockedOrderRequest.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 *QueryLockedOrderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLockedOrderRequest.Merge(m, src) +} +func (m *QueryLockedOrderRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLockedOrderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLockedOrderRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLockedOrderRequest proto.InternalMessageInfo + +func (m *QueryLockedOrderRequest) GetUser() string { + if m != nil { + return m.User + } + return "" +} + +type QueryLockedOrderResponse struct { + Total cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=total,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total"` +} + +func (m *QueryLockedOrderResponse) Reset() { *m = QueryLockedOrderResponse{} } +func (m *QueryLockedOrderResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLockedOrderResponse) ProtoMessage() {} +func (*QueryLockedOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_461504ebf74c9a97, []int{19} +} +func (m *QueryLockedOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLockedOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLockedOrderResponse.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 *QueryLockedOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLockedOrderResponse.Merge(m, src) +} +func (m *QueryLockedOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLockedOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLockedOrderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLockedOrderResponse proto.InternalMessageInfo + type QueryGetAmmPriceRequest struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` Decimal int32 `protobuf:"varint,2,opt,name=decimal,proto3" json:"decimal,omitempty"` @@ -811,7 +892,7 @@ func (m *QueryGetAmmPriceRequest) Reset() { *m = QueryGetAmmPriceRequest func (m *QueryGetAmmPriceRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetAmmPriceRequest) ProtoMessage() {} func (*QueryGetAmmPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_461504ebf74c9a97, []int{18} + return fileDescriptor_461504ebf74c9a97, []int{20} } func (m *QueryGetAmmPriceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -862,7 +943,7 @@ func (m *QueryGetAmmPriceResponse) Reset() { *m = QueryGetAmmPriceRespon func (m *QueryGetAmmPriceResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetAmmPriceResponse) ProtoMessage() {} func (*QueryGetAmmPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_461504ebf74c9a97, []int{19} + return fileDescriptor_461504ebf74c9a97, []int{21} } func (m *QueryGetAmmPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -899,7 +980,7 @@ func (m *QueryGetConsolidatedPriceRequest) Reset() { *m = QueryGetConsol func (m *QueryGetConsolidatedPriceRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetConsolidatedPriceRequest) ProtoMessage() {} func (*QueryGetConsolidatedPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_461504ebf74c9a97, []int{20} + return fileDescriptor_461504ebf74c9a97, []int{22} } func (m *QueryGetConsolidatedPriceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -945,7 +1026,7 @@ func (m *QueryGetConsolidatedPriceResponse) Reset() { *m = QueryGetConso func (m *QueryGetConsolidatedPriceResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetConsolidatedPriceResponse) ProtoMessage() {} func (*QueryGetConsolidatedPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_461504ebf74c9a97, []int{21} + return fileDescriptor_461504ebf74c9a97, []int{23} } func (m *QueryGetConsolidatedPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -982,7 +1063,7 @@ func (m *QueryStakedRequest) Reset() { *m = QueryStakedRequest{} } func (m *QueryStakedRequest) String() string { return proto.CompactTextString(m) } func (*QueryStakedRequest) ProtoMessage() {} func (*QueryStakedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_461504ebf74c9a97, []int{22} + return fileDescriptor_461504ebf74c9a97, []int{24} } func (m *QueryStakedRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1029,7 +1110,7 @@ func (m *QueryStakedResponse) Reset() { *m = QueryStakedResponse{} } func (m *QueryStakedResponse) String() string { return proto.CompactTextString(m) } func (*QueryStakedResponse) ProtoMessage() {} func (*QueryStakedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_461504ebf74c9a97, []int{23} + return fileDescriptor_461504ebf74c9a97, []int{25} } func (m *QueryStakedResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1066,7 +1147,7 @@ func (m *QueryGetUsersPoolDataRequest) Reset() { *m = QueryGetUsersPoolD func (m *QueryGetUsersPoolDataRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetUsersPoolDataRequest) ProtoMessage() {} func (*QueryGetUsersPoolDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_461504ebf74c9a97, []int{24} + return fileDescriptor_461504ebf74c9a97, []int{26} } func (m *QueryGetUsersPoolDataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1111,7 +1192,7 @@ func (m *QueryGetUsersPoolDataResponse) Reset() { *m = QueryGetUsersPool func (m *QueryGetUsersPoolDataResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetUsersPoolDataResponse) ProtoMessage() {} func (*QueryGetUsersPoolDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_461504ebf74c9a97, []int{25} + return fileDescriptor_461504ebf74c9a97, []int{27} } func (m *QueryGetUsersPoolDataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1173,6 +1254,8 @@ func init() { proto.RegisterType((*QueryPerpetualResponse)(nil), "elys.tier.QueryPerpetualResponse") proto.RegisterType((*QueryLiquidTotalRequest)(nil), "elys.tier.QueryLiquidTotalRequest") proto.RegisterType((*QueryLiquidTotalResponse)(nil), "elys.tier.QueryLiquidTotalResponse") + proto.RegisterType((*QueryLockedOrderRequest)(nil), "elys.tier.QueryLockedOrderRequest") + proto.RegisterType((*QueryLockedOrderResponse)(nil), "elys.tier.QueryLockedOrderResponse") proto.RegisterType((*QueryGetAmmPriceRequest)(nil), "elys.tier.QueryGetAmmPriceRequest") proto.RegisterType((*QueryGetAmmPriceResponse)(nil), "elys.tier.QueryGetAmmPriceResponse") proto.RegisterType((*QueryGetConsolidatedPriceRequest)(nil), "elys.tier.QueryGetConsolidatedPriceRequest") @@ -1186,93 +1269,95 @@ func init() { func init() { proto.RegisterFile("elys/tier/query.proto", fileDescriptor_461504ebf74c9a97) } var fileDescriptor_461504ebf74c9a97 = []byte{ - // 1363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x98, 0x4f, 0x6f, 0xdc, 0xc4, - 0x1b, 0xc7, 0xe3, 0xb4, 0xc9, 0xef, 0x97, 0x67, 0x43, 0xd3, 0x4e, 0xd3, 0x92, 0xba, 0xed, 0xb6, - 0x75, 0xa1, 0xd9, 0xb6, 0x89, 0xdd, 0x6c, 0x2b, 0x08, 0x20, 0x40, 0x4d, 0x56, 0x8d, 0x90, 0x02, - 0x4a, 0xb7, 0xa5, 0x07, 0x38, 0xac, 0x66, 0xed, 0xa9, 0x6b, 0xd5, 0xf6, 0xb8, 0xf6, 0x6c, 0x4a, - 0x54, 0xf5, 0xd2, 0x0b, 0x42, 0x48, 0x80, 0xe8, 0x01, 0x09, 0x21, 0x8e, 0xdc, 0x38, 0x20, 0xf1, - 0x12, 0x38, 0x54, 0x9c, 0x2a, 0xb8, 0x20, 0x0e, 0x15, 0x6a, 0x38, 0xf0, 0x32, 0x90, 0x67, 0xc6, - 0xbb, 0xf6, 0xda, 0xeb, 0x5d, 0x96, 0x5c, 0x38, 0x65, 0x3d, 0x7e, 0x9e, 0xef, 0xf3, 0x99, 0x67, - 0xfe, 0xf8, 0xab, 0xc0, 0x11, 0xe2, 0xee, 0x44, 0x06, 0x73, 0x48, 0x68, 0xdc, 0xeb, 0x90, 0x70, - 0x47, 0x0f, 0x42, 0xca, 0x28, 0x9a, 0x89, 0x87, 0xf5, 0x78, 0x58, 0x9d, 0xb7, 0xa9, 0x4d, 0xf9, - 0xa8, 0x11, 0xff, 0x12, 0x01, 0xea, 0x09, 0x9b, 0x52, 0xdb, 0x25, 0x06, 0x0e, 0x1c, 0x03, 0xfb, - 0x3e, 0x65, 0x98, 0x39, 0xd4, 0x8f, 0xe4, 0xdb, 0x0b, 0x26, 0x8d, 0x3c, 0x1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15, 0xbf, 0x56, 0xe0, 0x60, 0xff, 0xf7, 0x17, 0x2d, 0x16, 0x4c, 0xbd, 0xc8, - 0x0a, 0xa8, 0xb5, 0xe1, 0x81, 0xa3, 0x6e, 0xb1, 0xb8, 0x3f, 0xfc, 0x53, 0xce, 0xcf, 0x5d, 0xcb, - 0xc2, 0x0c, 0xaf, 0xad, 0x3f, 0x79, 0x5e, 0x55, 0x9e, 0x3e, 0xaf, 0x2a, 0x7f, 0x3c, 0xaf, 0x2a, - 0x5f, 0xec, 0x56, 0x27, 0x9e, 0xee, 0x56, 0x27, 0x7e, 0xdb, 0xad, 0x4e, 0x7c, 0x70, 0xde, 0x76, - 0xd8, 0x9d, 0x4e, 0x5b, 0x37, 0xa9, 0x57, 0x20, 0xf8, 0x91, 0x90, 0x64, 0x3b, 0x01, 0x89, 0xda, - 0xd3, 0xfc, 0x1f, 0x58, 0x97, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x68, 0xdb, 0xb2, 0xcb, 0xac, - 0x13, 0x00, 0x00, + // 1400 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x98, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xc7, 0xe3, 0xb4, 0x09, 0xe4, 0x6d, 0xe8, 0x8f, 0x69, 0x5a, 0x52, 0xb7, 0xdd, 0xb6, 0x2e, + 0x34, 0x69, 0x9b, 0xd8, 0x4d, 0x5a, 0x41, 0x00, 0x01, 0x6a, 0x12, 0x35, 0x42, 0x0a, 0x90, 0x6e, + 0x4b, 0x0f, 0x70, 0xb0, 0x66, 0xed, 0xa9, 0x6b, 0xc5, 0xf6, 0xb8, 0xf6, 0x6c, 0x4a, 0x54, 0xf5, + 0xd2, 0x0b, 0x07, 0x24, 0x40, 0xf4, 0x50, 0x09, 0x21, 0x8e, 0xdc, 0x38, 0x20, 0xf1, 0x27, 0x70, + 0xa8, 0x38, 0x55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0x9e, 0xd7, 0xc7, 0x7e, 0x7f, 0x5e, + 0x1f, 0xfb, 0xf8, 0x9c, 0xe3, 0xb2, 0xdb, 0xad, 0xa6, 0x6e, 0x51, 0xbf, 0x44, 0xf0, 0x53, 0x21, + 0xc9, 0x76, 0x43, 0x12, 0x37, 0x27, 0xf9, 0x9f, 0xf8, 0x2e, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, + 0xf4, 0x4b, 0x8f, 0x59, 0xce, 0x14, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1304,6 +1389,8 @@ type QueryClient interface { Perpetual(ctx context.Context, in *QueryPerpetualRequest, opts ...grpc.CallOption) (*QueryPerpetualResponse, error) // Queries a list of LiquidTotal items. LiquidTotal(ctx context.Context, in *QueryLiquidTotalRequest, opts ...grpc.CallOption) (*QueryLiquidTotalResponse, error) + // Queries a list of LockedOrder items. + LockedOrder(ctx context.Context, in *QueryLockedOrderRequest, opts ...grpc.CallOption) (*QueryLockedOrderResponse, error) // Queries a list of GetAmmPrice items. GetAmmPrice(ctx context.Context, in *QueryGetAmmPriceRequest, opts ...grpc.CallOption) (*QueryGetAmmPriceResponse, error) // Queries a list of GetConsolidatedPrice items. @@ -1403,6 +1490,15 @@ func (c *queryClient) LiquidTotal(ctx context.Context, in *QueryLiquidTotalReque return out, nil } +func (c *queryClient) LockedOrder(ctx context.Context, in *QueryLockedOrderRequest, opts ...grpc.CallOption) (*QueryLockedOrderResponse, error) { + out := new(QueryLockedOrderResponse) + err := c.cc.Invoke(ctx, "/elys.tier.Query/LockedOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) GetAmmPrice(ctx context.Context, in *QueryGetAmmPriceRequest, opts ...grpc.CallOption) (*QueryGetAmmPriceResponse, error) { out := new(QueryGetAmmPriceResponse) err := c.cc.Invoke(ctx, "/elys.tier.Query/GetAmmPrice", in, out, opts...) @@ -1458,6 +1554,8 @@ type QueryServer interface { Perpetual(context.Context, *QueryPerpetualRequest) (*QueryPerpetualResponse, error) // Queries a list of LiquidTotal items. LiquidTotal(context.Context, *QueryLiquidTotalRequest) (*QueryLiquidTotalResponse, error) + // Queries a list of LockedOrder items. + LockedOrder(context.Context, *QueryLockedOrderRequest) (*QueryLockedOrderResponse, error) // Queries a list of GetAmmPrice items. GetAmmPrice(context.Context, *QueryGetAmmPriceRequest) (*QueryGetAmmPriceResponse, error) // Queries a list of GetConsolidatedPrice items. @@ -1499,6 +1597,9 @@ func (*UnimplementedQueryServer) Perpetual(ctx context.Context, req *QueryPerpet func (*UnimplementedQueryServer) LiquidTotal(ctx context.Context, req *QueryLiquidTotalRequest) (*QueryLiquidTotalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LiquidTotal not implemented") } +func (*UnimplementedQueryServer) LockedOrder(ctx context.Context, req *QueryLockedOrderRequest) (*QueryLockedOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LockedOrder not implemented") +} func (*UnimplementedQueryServer) GetAmmPrice(ctx context.Context, req *QueryGetAmmPriceRequest) (*QueryGetAmmPriceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAmmPrice not implemented") } @@ -1678,6 +1779,24 @@ func _Query_LiquidTotal_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_LockedOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLockedOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LockedOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/elys.tier.Query/LockedOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LockedOrder(ctx, req.(*QueryLockedOrderRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_GetAmmPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetAmmPriceRequest) if err := dec(in); err != nil { @@ -1790,6 +1909,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "LiquidTotal", Handler: _Query_LiquidTotal_Handler, }, + { + MethodName: "LockedOrder", + Handler: _Query_LockedOrder_Handler, + }, { MethodName: "GetAmmPrice", Handler: _Query_GetAmmPrice_Handler, @@ -2418,6 +2541,69 @@ func (m *QueryLiquidTotalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *QueryLockedOrderRequest) 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 *QueryLockedOrderRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLockedOrderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintQuery(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLockedOrderResponse) 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 *QueryLockedOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLockedOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Total.Size() + i -= size + if _, err := m.Total.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *QueryGetAmmPriceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2989,6 +3175,30 @@ func (m *QueryLiquidTotalResponse) Size() (n int) { return n } +func (m *QueryLockedOrderRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLockedOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Total.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryGetAmmPriceRequest) Size() (n int) { if m == nil { return 0 @@ -4713,6 +4923,172 @@ func (m *QueryLiquidTotalResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryLockedOrderRequest) 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: QueryLockedOrderRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLockedOrderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", 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.User = 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 *QueryLockedOrderResponse) 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: QueryLockedOrderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLockedOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", 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 + } + if err := m.Total.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 *QueryGetAmmPriceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/tier/types/query.pb.gw.go b/x/tier/types/query.pb.gw.go index 4542b32e6..fa01ef133 100644 --- a/x/tier/types/query.pb.gw.go +++ b/x/tier/types/query.pb.gw.go @@ -465,6 +465,60 @@ func local_request_Query_LiquidTotal_0(ctx context.Context, marshaler runtime.Ma } +func request_Query_LockedOrder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLockedOrderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["user"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user") + } + + protoReq.User, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user", err) + } + + msg, err := client.LockedOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LockedOrder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLockedOrderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["user"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user") + } + + protoReq.User, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user", err) + } + + msg, err := server.LockedOrder(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_GetAmmPrice_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetAmmPriceRequest var metadata runtime.ServerMetadata @@ -898,6 +952,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_LockedOrder_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_LockedOrder_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_LockedOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_GetAmmPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1211,6 +1288,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_LockedOrder_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_LockedOrder_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_LockedOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_GetAmmPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1313,6 +1410,8 @@ var ( pattern_Query_LiquidTotal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"elys-network", "elys", "tier", "liquid_total", "user"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_LockedOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"elys-network", "elys", "tier", "locked_order", "user"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetAmmPrice_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{"elys-network", "elys", "tier", "get_amm_price", "denom", "decimal"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_GetConsolidatedPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"elys-network", "elys", "tier", "get_consolidated_price", "denom"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1341,6 +1440,8 @@ var ( forward_Query_LiquidTotal_0 = runtime.ForwardResponseMessage + forward_Query_LockedOrder_0 = runtime.ForwardResponseMessage + forward_Query_GetAmmPrice_0 = runtime.ForwardResponseMessage forward_Query_GetConsolidatedPrice_0 = runtime.ForwardResponseMessage From 6df94639cd661b95ca8b25d157c50bb9efc3f828 Mon Sep 17 00:00:00 2001 From: Amit Yadav Date: Tue, 3 Dec 2024 09:08:28 +0530 Subject: [PATCH 2/3] [Estaking]: Remove legacy structure and code (#1008) * remove legacy code * remove legacy structures * remove --- proto/elys/estaking/dex_rewards_tracker.proto | 16 - proto/elys/estaking/incentive.proto | 28 - proto/elys/estaking/params.proto | 22 - x/estaking/keeper/elys_stake_change.go | 24 - x/estaking/keeper/elys_stake_change_test.go | 42 -- x/estaking/keeper/elys_staked.go | 30 -- x/estaking/keeper/elys_staked_test.go | 34 -- x/estaking/keeper/keeper_test.go | 9 +- x/estaking/keeper/msg_server_test.go | 1 + x/estaking/keeper/params.go | 19 - x/estaking/keeper/params_test.go | 29 -- x/estaking/migrations/v3_migration.go | 18 - x/estaking/types/dex_rewards_tracker.pb.go | 259 +-------- x/estaking/types/incentive.pb.go | 359 +------------ x/estaking/types/params.go | 9 +- x/estaking/types/params.pb.go | 490 ++---------------- 16 files changed, 65 insertions(+), 1324 deletions(-) diff --git a/proto/elys/estaking/dex_rewards_tracker.proto b/proto/elys/estaking/dex_rewards_tracker.proto index e000462f3..f4677d018 100644 --- a/proto/elys/estaking/dex_rewards_tracker.proto +++ b/proto/elys/estaking/dex_rewards_tracker.proto @@ -20,19 +20,3 @@ message DexRewardsTracker { (gogoproto.nullable) = false ]; } - -message LegacyDexRewardsTracker { - // Number of blocks since start of epoch (distribution epoch) - string num_blocks = 1 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false - ]; - // Accumulated amount at distribution epoch - recalculated at every - // distribution epoch - string amount = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} diff --git a/proto/elys/estaking/incentive.proto b/proto/elys/estaking/incentive.proto index 359cd98af..344656734 100644 --- a/proto/elys/estaking/incentive.proto +++ b/proto/elys/estaking/incentive.proto @@ -6,34 +6,6 @@ import "cosmos_proto/cosmos.proto"; option go_package = "github.com/elys-network/elys/x/estaking/types"; -// Incentive Info -message LegacyIncentiveInfo { - // reward amount in eden for 1 year - string eden_amount_per_year = 1 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false - ]; - // starting block height of the distribution - string distribution_start_block = 2 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false - ]; - // distribution duration - block number per year - string total_blocks_per_year = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false - ]; - // blocks distributed - string blocks_distributed = 4 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false - ]; -} - message IncentiveInfo { // reward amount in eden for 1 year string eden_amount_per_year = 1 [ diff --git a/proto/elys/estaking/params.proto b/proto/elys/estaking/params.proto index 8bdf10ac4..e704b9fe2 100644 --- a/proto/elys/estaking/params.proto +++ b/proto/elys/estaking/params.proto @@ -8,28 +8,6 @@ import "cosmos_proto/cosmos.proto"; option go_package = "github.com/elys-network/elys/x/estaking/types"; -message LegacyParams { - option (gogoproto.goproto_stringer) = false; - - LegacyIncentiveInfo stake_incentives = 1; - string eden_commit_val = 2; - string edenb_commit_val = 3; - // Maximum eden reward apr for stakers - [0 - 0.3] - string max_eden_reward_apr_stakers = 5 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string eden_boost_apr = 6 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - // Tracking dex rewards given to stakers - LegacyDexRewardsTracker dex_rewards_stakers = 7 - [ (gogoproto.nullable) = false ]; -} - // Params defines the parameters for the module. message Params { IncentiveInfo stake_incentives = 1; diff --git a/x/estaking/keeper/elys_stake_change.go b/x/estaking/keeper/elys_stake_change.go index 85ba15580..859ef5d18 100644 --- a/x/estaking/keeper/elys_stake_change.go +++ b/x/estaking/keeper/elys_stake_change.go @@ -26,17 +26,6 @@ func (k Keeper) RemoveElysStakeChange(ctx sdk.Context, address sdk.AccAddress) { store.Delete(key) } -func (k Keeper) SetLegacyElysStakeChange(ctx sdk.Context, addr sdk.AccAddress) { - store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.LegacyKeyPrefix(types.LegacyElysStakeChangeKeyPrefix)) - key := types.GetElysStakeChangeKey(addr) - store.Set(key, addr) -} - -func (k Keeper) DeleteLegacyElysStakeChange(ctx sdk.Context, address sdk.AccAddress) { - store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.LegacyKeyPrefix(types.LegacyElysStakeChangeKeyPrefix)) - store.Delete([]byte(address)) -} - func (k Keeper) GetAllElysStakeChange(ctx sdk.Context) (list []sdk.AccAddress) { store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.ElysStakeChangeKeyPrefix) iterator := storetypes.KVStorePrefixIterator(store, []byte{}) @@ -49,16 +38,3 @@ func (k Keeper) GetAllElysStakeChange(ctx sdk.Context) (list []sdk.AccAddress) { return } - -func (k Keeper) GetAllLegacyElysStakeChange(ctx sdk.Context) (list []sdk.AccAddress) { - store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.LegacyKeyPrefix(types.LegacyElysStakeChangeKeyPrefix)) - iterator := storetypes.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - list = append(list, sdk.AccAddress(iterator.Value())) - } - - return -} diff --git a/x/estaking/keeper/elys_stake_change_test.go b/x/estaking/keeper/elys_stake_change_test.go index 299820cae..0067b15fd 100644 --- a/x/estaking/keeper/elys_stake_change_test.go +++ b/x/estaking/keeper/elys_stake_change_test.go @@ -27,48 +27,6 @@ func (suite *EstakingKeeperTestSuite) TestElysStakeChange() { suite.Require().True(found) }, }, - { - "delete legacy elys stake change", - func() (addr sdk.AccAddress) { - suite.ResetSuite() - - addr = suite.AddAccounts(1, nil)[0] - - return addr - }, - func(addr sdk.AccAddress) { - suite.app.EstakingKeeper.DeleteLegacyElysStakeChange(suite.ctx, addr) - }, - }, - { - "get all legacy elys stake change with no data", - func() (addr sdk.AccAddress) { - suite.ResetSuite() - - return sdk.AccAddress{} - }, - func(addr sdk.AccAddress) { - list := suite.app.EstakingKeeper.GetAllLegacyElysStakeChange(suite.ctx) - suite.Require().Equal(0, len(list)) - }, - }, - { - "get all legacy elys stake change with data", - func() (addr sdk.AccAddress) { - suite.ResetSuite() - - addr = suite.AddAccounts(1, nil)[0] - - // set legacy elys stake change - suite.app.EstakingKeeper.SetLegacyElysStakeChange(suite.ctx, addr) - - return sdk.AccAddress{} - }, - func(addr sdk.AccAddress) { - list := suite.app.EstakingKeeper.GetAllLegacyElysStakeChange(suite.ctx) - suite.Require().Equal(1, len(list)) - }, - }, } for _, tc := range testCases { diff --git a/x/estaking/keeper/elys_staked.go b/x/estaking/keeper/elys_staked.go index 975ae2929..a6ae938a1 100644 --- a/x/estaking/keeper/elys_staked.go +++ b/x/estaking/keeper/elys_staked.go @@ -54,33 +54,3 @@ func (k Keeper) GetAllElysStaked(ctx sdk.Context) (list []types.ElysStaked) { return } - -// SetLegacyElysStaked set a specific elysStaked in the store from its index -func (k Keeper) SetLegacyElysStaked(ctx sdk.Context, elysStaked types.ElysStaked) { - store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.LegacyKeyPrefix(types.LegacyElysStakedKeyPrefix)) - b := k.cdc.MustMarshal(&elysStaked) - key := types.GetElysStakedKey(elysStaked.GetAccountAddress()) - store.Set(key, b) -} - -// remove after migration -func (k Keeper) GetAllLegacyElysStaked(ctx sdk.Context) (list []types.ElysStaked) { - store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.LegacyKeyPrefix(types.LegacyElysStakedKeyPrefix)) - iterator := storetypes.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.ElysStaked - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - -// TODO: remove all legacy prefixes and functions after migration -func (k Keeper) DeleteLegacyElysStaked(ctx sdk.Context, address string) { - store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.LegacyKeyPrefix(types.LegacyElysStakedKeyPrefix)) - store.Delete(types.LegacyElysStakedKey(address)) -} diff --git a/x/estaking/keeper/elys_staked_test.go b/x/estaking/keeper/elys_staked_test.go index 29b48b2c0..7b924b4a3 100644 --- a/x/estaking/keeper/elys_staked_test.go +++ b/x/estaking/keeper/elys_staked_test.go @@ -59,40 +59,6 @@ func (suite *EstakingKeeperTestSuite) TestElysStaked() { suite.Require().Equal(2, len(list)) }, }, - { - "get all legacy elys staked", - func() (addr sdk.AccAddress) { - suite.ResetSuite() - - addr = suite.AddAccounts(1, nil)[0] - - // set elys staked - suite.app.EstakingKeeper.SetLegacyElysStaked(suite.ctx, types.ElysStaked{ - Address: addr.String(), - Amount: math.NewInt(1000), - }) - - return addr - }, - func(addr sdk.AccAddress) { - list := suite.app.EstakingKeeper.GetAllLegacyElysStaked(suite.ctx) - suite.Require().Equal(1, len(list)) - suite.Require().Equal(math.NewInt(1000), list[0].Amount) - }, - }, - { - "delete legacy elys staked", - func() (addr sdk.AccAddress) { - suite.ResetSuite() - - addr = suite.AddAccounts(1, nil)[0] - - return addr - }, - func(addr sdk.AccAddress) { - suite.app.EstakingKeeper.DeleteLegacyElysStaked(suite.ctx, addr.String()) - }, - }, } for _, tc := range testCases { diff --git a/x/estaking/keeper/keeper_test.go b/x/estaking/keeper/keeper_test.go index 88b876402..f1a905876 100644 --- a/x/estaking/keeper/keeper_test.go +++ b/x/estaking/keeper/keeper_test.go @@ -8,7 +8,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - stypes "github.com/cosmos/cosmos-sdk/x/staking/types" simapp "github.com/elys-network/elys/app" aptypes "github.com/elys-network/elys/x/assetprofile/types" ckeeper "github.com/elys-network/elys/x/commitment/keeper" @@ -169,6 +168,7 @@ func (suite *EstakingKeeperTestSuite) TestEstakingExtendedFunctions() { suite.Require().Nil(err) delegations, err := suite.app.StakingKeeper.GetValidatorDelegations(suite.ctx, operatorAddr) + suite.Require().Nil(err) suite.Require().True(len(delegations) > 0) addr := sdk.MustAccAddressFromBech32(delegations[0].DelegatorAddress) @@ -212,6 +212,7 @@ func (suite *EstakingKeeperTestSuite) TestEstakingExtendedFunctions() { suite.Require().Nil(err) suite.Require().Equal(validator, edenVal) validator, err = suite.app.EstakingKeeper.Validator(suite.ctx, operatorBValAddr) + suite.Require().Nil(err) suite.Require().Equal(validator, edenBVal) edenDel, err := suite.app.EstakingKeeper.Delegation(suite.ctx, addr, operatorValAddr) @@ -223,14 +224,14 @@ func (suite *EstakingKeeperTestSuite) TestEstakingExtendedFunctions() { suite.Require().Nil(edenBDel) numDelegations := int64(0) - suite.app.EstakingKeeper.IterateDelegations(suite.ctx, addr, func(index int64, delegation stypes.DelegationI) (stop bool) { + suite.app.EstakingKeeper.IterateDelegations(suite.ctx, addr, func(index int64, delegation stakingtypes.DelegationI) (stop bool) { numDelegations++ return false }) suite.Require().Equal(numDelegations, int64(2)) numBondedValidators := int64(0) - suite.app.EstakingKeeper.IterateBondedValidatorsByPower(suite.ctx, func(index int64, delegation stypes.ValidatorI) (stop bool) { + suite.app.EstakingKeeper.IterateBondedValidatorsByPower(suite.ctx, func(index int64, delegation stakingtypes.ValidatorI) (stop bool) { numBondedValidators++ return false }) @@ -238,7 +239,7 @@ func (suite *EstakingKeeperTestSuite) TestEstakingExtendedFunctions() { // test IterateValidators numValidators := int64(0) - suite.app.EstakingKeeper.IterateValidators(suite.ctx, func(index int64, validator stypes.ValidatorI) (stop bool) { + suite.app.EstakingKeeper.IterateValidators(suite.ctx, func(index int64, validator stakingtypes.ValidatorI) (stop bool) { numValidators++ return false }) diff --git a/x/estaking/keeper/msg_server_test.go b/x/estaking/keeper/msg_server_test.go index b838686d1..58b5ddf75 100644 --- a/x/estaking/keeper/msg_server_test.go +++ b/x/estaking/keeper/msg_server_test.go @@ -136,6 +136,7 @@ func (suite *EstakingKeeperTestSuite) TestMsgServer() { suite.Require().Nil(err) delegations, err := suite.app.StakingKeeper.GetValidatorDelegations(suite.ctx, valAddr) + suite.Require().Nil(err) suite.Require().True(len(delegations) > 0) addr := sdk.MustAccAddressFromBech32(delegations[0].DelegatorAddress) diff --git a/x/estaking/keeper/params.go b/x/estaking/keeper/params.go index b75716015..2b461b73d 100644 --- a/x/estaking/keeper/params.go +++ b/x/estaking/keeper/params.go @@ -19,28 +19,9 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { return } -func (k Keeper) GetLegacyParams(ctx sdk.Context) (params types.LegacyParams) { - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - - b := store.Get(types.ParamsKeyPrefix) - if b == nil { - return - } - - k.cdc.MustUnmarshal(b, ¶ms) - return -} - // SetParams set the params func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) b := k.cdc.MustMarshal(¶ms) store.Set(types.ParamsKeyPrefix, b) } - -// SetLegacyParams set the params -func (k Keeper) SetLegacyParams(ctx sdk.Context, params types.LegacyParams) { - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - b := k.cdc.MustMarshal(¶ms) - store.Set(types.ParamsKeyPrefix, b) -} diff --git a/x/estaking/keeper/params_test.go b/x/estaking/keeper/params_test.go index 4e42d467f..091e6f773 100644 --- a/x/estaking/keeper/params_test.go +++ b/x/estaking/keeper/params_test.go @@ -1,7 +1,6 @@ package keeper_test import ( - "cosmossdk.io/math" "github.com/elys-network/elys/x/estaking/types" ) @@ -26,34 +25,6 @@ func (suite *EstakingKeeperTestSuite) TestParams() { suite.Require().EqualValues(params, suite.app.EstakingKeeper.GetParams(suite.ctx)) }, }, - { - "get legacy params", - func() { - suite.ResetSuite() - }, - func() { - legacyParams := types.LegacyParams{ - StakeIncentives: &types.LegacyIncentiveInfo{ - EdenAmountPerYear: math.NewInt(0), - DistributionStartBlock: math.NewInt(0), - TotalBlocksPerYear: math.NewInt(0), - BlocksDistributed: math.NewInt(0), - }, - EdenCommitVal: "", - EdenbCommitVal: "", - MaxEdenRewardAprStakers: math.LegacyNewDec(0), - EdenBoostApr: math.LegacyNewDec(0), - DexRewardsStakers: types.LegacyDexRewardsTracker{ - NumBlocks: math.NewInt(0), - Amount: math.LegacyNewDec(0), - }, - } - - suite.app.EstakingKeeper.SetLegacyParams(suite.ctx, legacyParams) - - suite.Require().EqualValues(legacyParams, suite.app.EstakingKeeper.GetLegacyParams(suite.ctx)) - }, - }, } for _, tc := range testCases { diff --git a/x/estaking/migrations/v3_migration.go b/x/estaking/migrations/v3_migration.go index a456277d7..ffd4806d4 100644 --- a/x/estaking/migrations/v3_migration.go +++ b/x/estaking/migrations/v3_migration.go @@ -2,27 +2,9 @@ package migrations import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/elys-network/elys/x/estaking/types" ) func (m Migrator) V3Migration(ctx sdk.Context) error { - legacyParams := m.keeper.GetLegacyParams(ctx) - params := types.Params{} - if legacyParams.StakeIncentives != nil { - params.StakeIncentives = &types.IncentiveInfo{ - EdenAmountPerYear: legacyParams.StakeIncentives.EdenAmountPerYear, - BlocksDistributed: legacyParams.StakeIncentives.BlocksDistributed.Int64(), - } - } - params.EdenCommitVal = legacyParams.EdenCommitVal - params.EdenbCommitVal = legacyParams.EdenbCommitVal - params.MaxEdenRewardAprStakers = legacyParams.MaxEdenRewardAprStakers - params.EdenBoostApr = legacyParams.EdenBoostApr - params.DexRewardsStakers = types.DexRewardsTracker{ - NumBlocks: legacyParams.DexRewardsStakers.NumBlocks.Int64(), - Amount: legacyParams.DexRewardsStakers.Amount, - } - m.keeper.SetParams(ctx, params) return nil } diff --git a/x/estaking/types/dex_rewards_tracker.pb.go b/x/estaking/types/dex_rewards_tracker.pb.go index e3d545b48..8db41db8a 100644 --- a/x/estaking/types/dex_rewards_tracker.pb.go +++ b/x/estaking/types/dex_rewards_tracker.pb.go @@ -75,50 +75,8 @@ func (m *DexRewardsTracker) GetNumBlocks() int64 { return 0 } -type LegacyDexRewardsTracker struct { - // Number of blocks since start of epoch (distribution epoch) - NumBlocks cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=num_blocks,json=numBlocks,proto3,customtype=cosmossdk.io/math.Int" json:"num_blocks"` - // Accumulated amount at distribution epoch - recalculated at every - // distribution epoch - Amount cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"amount"` -} - -func (m *LegacyDexRewardsTracker) Reset() { *m = LegacyDexRewardsTracker{} } -func (m *LegacyDexRewardsTracker) String() string { return proto.CompactTextString(m) } -func (*LegacyDexRewardsTracker) ProtoMessage() {} -func (*LegacyDexRewardsTracker) Descriptor() ([]byte, []int) { - return fileDescriptor_061875a2058b444a, []int{1} -} -func (m *LegacyDexRewardsTracker) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LegacyDexRewardsTracker) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LegacyDexRewardsTracker.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 *LegacyDexRewardsTracker) XXX_Merge(src proto.Message) { - xxx_messageInfo_LegacyDexRewardsTracker.Merge(m, src) -} -func (m *LegacyDexRewardsTracker) XXX_Size() int { - return m.Size() -} -func (m *LegacyDexRewardsTracker) XXX_DiscardUnknown() { - xxx_messageInfo_LegacyDexRewardsTracker.DiscardUnknown(m) -} - -var xxx_messageInfo_LegacyDexRewardsTracker proto.InternalMessageInfo - func init() { proto.RegisterType((*DexRewardsTracker)(nil), "elys.estaking.DexRewardsTracker") - proto.RegisterType((*LegacyDexRewardsTracker)(nil), "elys.estaking.LegacyDexRewardsTracker") } func init() { @@ -126,7 +84,7 @@ func init() { } var fileDescriptor_061875a2058b444a = []byte{ - // 306 bytes of a gzipped FileDescriptorProto + // 274 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xcd, 0xa9, 0x2c, 0xd6, 0x4f, 0x2d, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xd7, 0x4f, 0x49, 0xad, 0x88, 0x2f, 0x4a, 0x2d, 0x4f, 0x2c, 0x4a, 0x29, 0x8e, 0x2f, 0x29, 0x4a, 0x4c, 0xce, 0x4e, 0x2d, 0xd2, 0x2b, 0x28, @@ -138,14 +96,12 @@ var fileDescriptor_061875a2058b444a = []byte{ 0x93, 0x8b, 0x2d, 0x31, 0x37, 0xbf, 0x34, 0xaf, 0x44, 0x82, 0x49, 0x81, 0x51, 0x83, 0xd3, 0xc9, 0xf0, 0xc4, 0x3d, 0x79, 0x86, 0x5b, 0xf7, 0xe4, 0xa5, 0x21, 0xf6, 0x15, 0xa7, 0x64, 0xeb, 0x65, 0xe6, 0xeb, 0xe7, 0x26, 0x96, 0x64, 0xe8, 0xf9, 0xa4, 0xa6, 0x27, 0x26, 0x57, 0xba, 0xa4, 0x26, - 0x5f, 0xda, 0xa2, 0xcb, 0x05, 0x75, 0x8e, 0x4b, 0x6a, 0x72, 0x10, 0xd4, 0x00, 0xa5, 0x0d, 0x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47, 0xbf, 0x02, 0x11, 0x3e, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, + 0x6c, 0x60, 0x2f, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x15, 0x85, 0x5e, 0x3d, 0x01, 0x00, 0x00, } @@ -176,33 +132,6 @@ func (this *DexRewardsTracker) Equal(that interface{}) bool { } return true } -func (this *LegacyDexRewardsTracker) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LegacyDexRewardsTracker) - if !ok { - that2, ok := that.(LegacyDexRewardsTracker) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.NumBlocks.Equal(that1.NumBlocks) { - return false - } - if !this.Amount.Equal(that1.Amount) { - return false - } - return true -} func (m *DexRewardsTracker) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -241,49 +170,6 @@ func (m *DexRewardsTracker) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *LegacyDexRewardsTracker) 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 *LegacyDexRewardsTracker) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LegacyDexRewardsTracker) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Amount.Size() - i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDexRewardsTracker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.NumBlocks.Size() - i -= size - if _, err := m.NumBlocks.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDexRewardsTracker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func encodeVarintDexRewardsTracker(dAtA []byte, offset int, v uint64) int { offset -= sovDexRewardsTracker(v) base := offset @@ -309,19 +195,6 @@ func (m *DexRewardsTracker) Size() (n int) { return n } -func (m *LegacyDexRewardsTracker) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.NumBlocks.Size() - n += 1 + l + sovDexRewardsTracker(uint64(l)) - l = m.Amount.Size() - n += 1 + l + sovDexRewardsTracker(uint64(l)) - return n -} - func sovDexRewardsTracker(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -431,124 +304,6 @@ func (m *DexRewardsTracker) Unmarshal(dAtA []byte) error { } return nil } -func (m *LegacyDexRewardsTracker) 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 ErrIntOverflowDexRewardsTracker - } - 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: LegacyDexRewardsTracker: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LegacyDexRewardsTracker: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NumBlocks", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDexRewardsTracker - } - 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 ErrInvalidLengthDexRewardsTracker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDexRewardsTracker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.NumBlocks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDexRewardsTracker - } - 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 ErrInvalidLengthDexRewardsTracker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDexRewardsTracker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDexRewardsTracker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDexRewardsTracker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipDexRewardsTracker(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/estaking/types/incentive.pb.go b/x/estaking/types/incentive.pb.go index 0726458fd..ee56b7b5f 100644 --- a/x/estaking/types/incentive.pb.go +++ b/x/estaking/types/incentive.pb.go @@ -26,51 +26,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Incentive Info -type LegacyIncentiveInfo struct { - // reward amount in eden for 1 year - EdenAmountPerYear cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=eden_amount_per_year,json=edenAmountPerYear,proto3,customtype=cosmossdk.io/math.Int" json:"eden_amount_per_year"` - // starting block height of the distribution - DistributionStartBlock cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=distribution_start_block,json=distributionStartBlock,proto3,customtype=cosmossdk.io/math.Int" json:"distribution_start_block"` - // distribution duration - block number per year - TotalBlocksPerYear cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=total_blocks_per_year,json=totalBlocksPerYear,proto3,customtype=cosmossdk.io/math.Int" json:"total_blocks_per_year"` - // blocks distributed - BlocksDistributed cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=blocks_distributed,json=blocksDistributed,proto3,customtype=cosmossdk.io/math.Int" json:"blocks_distributed"` -} - -func (m *LegacyIncentiveInfo) Reset() { *m = LegacyIncentiveInfo{} } -func (m *LegacyIncentiveInfo) String() string { return proto.CompactTextString(m) } -func (*LegacyIncentiveInfo) ProtoMessage() {} -func (*LegacyIncentiveInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_e9de1d3bcda4768b, []int{0} -} -func (m *LegacyIncentiveInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LegacyIncentiveInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LegacyIncentiveInfo.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 *LegacyIncentiveInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_LegacyIncentiveInfo.Merge(m, src) -} -func (m *LegacyIncentiveInfo) XXX_Size() int { - return m.Size() -} -func (m *LegacyIncentiveInfo) XXX_DiscardUnknown() { - xxx_messageInfo_LegacyIncentiveInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_LegacyIncentiveInfo proto.InternalMessageInfo - type IncentiveInfo struct { // reward amount in eden for 1 year EdenAmountPerYear cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=eden_amount_per_year,json=edenAmountPerYear,proto3,customtype=cosmossdk.io/math.Int" json:"eden_amount_per_year"` @@ -82,7 +37,7 @@ func (m *IncentiveInfo) Reset() { *m = IncentiveInfo{} } func (m *IncentiveInfo) String() string { return proto.CompactTextString(m) } func (*IncentiveInfo) ProtoMessage() {} func (*IncentiveInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_e9de1d3bcda4768b, []int{1} + return fileDescriptor_e9de1d3bcda4768b, []int{0} } func (m *IncentiveInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -119,101 +74,32 @@ func (m *IncentiveInfo) GetBlocksDistributed() int64 { } func init() { - proto.RegisterType((*LegacyIncentiveInfo)(nil), "elys.estaking.LegacyIncentiveInfo") proto.RegisterType((*IncentiveInfo)(nil), "elys.estaking.IncentiveInfo") } func init() { proto.RegisterFile("elys/estaking/incentive.proto", fileDescriptor_e9de1d3bcda4768b) } var fileDescriptor_e9de1d3bcda4768b = []byte{ - // 375 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x92, 0xc1, 0xca, 0xd3, 0x40, - 0x10, 0xc7, 0x13, 0x2b, 0x82, 0x0b, 0xdf, 0xc1, 0xf8, 0x55, 0x62, 0xc1, 0x54, 0x7a, 0x12, 0x24, - 0xd9, 0x83, 0x4f, 0x60, 0x11, 0x24, 0xe0, 0x41, 0xf4, 0x64, 0x11, 0xc3, 0x26, 0x99, 0xa6, 0x4b, - 0x92, 0x9d, 0xb0, 0x3b, 0x51, 0xf3, 0x16, 0x9e, 0x3c, 0xf9, 0x18, 0x3e, 0x44, 0x8f, 0xc5, 0x93, - 0x78, 0x28, 0xd2, 0xbe, 0x88, 0x6c, 0xd2, 0x5a, 0x0f, 0xbd, 0xd4, 0xc3, 0x77, 0xdb, 0xe1, 0x3f, - 0xf3, 0xfb, 0xcf, 0xec, 0x0c, 0x7b, 0x04, 0x55, 0x67, 0x38, 0x18, 0x12, 0xa5, 0x54, 0x05, 0x97, - 0x2a, 0x03, 0x45, 0xf2, 0x23, 0x44, 0x8d, 0x46, 0x42, 0xef, 0xca, 0xca, 0xd1, 0x51, 0x9e, 0x5c, - 0x17, 0x58, 0x60, 0xaf, 0x70, 0xfb, 0x1a, 0x92, 0x26, 0xd3, 0x02, 0xb1, 0xa8, 0x80, 0xf7, 0x51, - 0xda, 0x2e, 0x39, 0xc9, 0xda, 0x96, 0xd4, 0xcd, 0x21, 0xe1, 0x61, 0x86, 0xa6, 0x46, 0x93, 0x0c, - 0x95, 0x43, 0x30, 0x48, 0xb3, 0xaf, 0x23, 0x76, 0xff, 0x15, 0x14, 0x22, 0xeb, 0xe2, 0xa3, 0x75, - 0xac, 0x96, 0xe8, 0xbd, 0x67, 0xd7, 0x90, 0x83, 0x4a, 0x44, 0x8d, 0xad, 0xa2, 0xa4, 0x01, 0x9d, - 0x74, 0x20, 0xb4, 0xef, 0x3e, 0x76, 0x9f, 0xdc, 0x9d, 0x3f, 0x5d, 0x6f, 0xa7, 0xce, 0xaf, 0xed, - 0x74, 0x3c, 0xb0, 0x4c, 0x5e, 0x46, 0x12, 0x79, 0x2d, 0x68, 0x15, 0xc5, 0x8a, 0x7e, 0x7c, 0x0f, - 0xd9, 0xc1, 0x24, 0x56, 0xf4, 0xe6, 0x9e, 0x05, 0x3d, 0xef, 0x39, 0xaf, 0x41, 0xbf, 0x03, 0xa1, - 0x3d, 0x60, 0x7e, 0x2e, 0x0d, 0x69, 0x99, 0xb6, 0x24, 0x51, 0x25, 0x86, 0x84, 0xa6, 0x24, 0xad, - 0x30, 0x2b, 0xfd, 0x5b, 0x97, 0x3b, 0x3c, 0xf8, 0x17, 0xf6, 0xd6, 0xb2, 0xe6, 0x16, 0xe5, 0x7d, - 0x60, 0x63, 0x42, 0x12, 0xd5, 0x40, 0x36, 0xa7, 0x29, 0x46, 0x97, 0x7b, 0x78, 0x3d, 0xa9, 0xe7, - 0x9a, 0xe3, 0x18, 0x0b, 0xe6, 0x1d, 0xc8, 0x7f, 0x1b, 0x80, 0xdc, 0xbf, 0xfd, 0x1f, 0x5f, 0x34, - 0x60, 0x5e, 0x9c, 0x28, 0xb3, 0x6f, 0x2e, 0xbb, 0xba, 0xc9, 0x95, 0x84, 0x67, 0x67, 0xb1, 0xcb, - 0x18, 0x9d, 0x69, 0x6f, 0xfe, 0x72, 0xbd, 0x0b, 0xdc, 0xcd, 0x2e, 0x70, 0x7f, 0xef, 0x02, 0xf7, - 0xcb, 0x3e, 0x70, 0x36, 0xfb, 0xc0, 0xf9, 0xb9, 0x0f, 0x9c, 0x45, 0x58, 0x48, 0x5a, 0xb5, 0x69, - 0x94, 0x61, 0xcd, 0xed, 0xf5, 0x86, 0x0a, 0xe8, 0x13, 0xea, 0xb2, 0x0f, 0xf8, 0xe7, 0xd3, 0xad, - 0x53, 0xd7, 0x80, 0x49, 0xef, 0xf4, 0x77, 0xf8, 0xec, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbb, - 0x78, 0x8a, 0x8e, 0x09, 0x03, 0x00, 0x00, -} - -func (m *LegacyIncentiveInfo) 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 *LegacyIncentiveInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LegacyIncentiveInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.BlocksDistributed.Size() - i -= size - if _, err := m.BlocksDistributed.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintIncentive(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.TotalBlocksPerYear.Size() - i -= size - if _, err := m.TotalBlocksPerYear.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintIncentive(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.DistributionStartBlock.Size() - i -= size - if _, err := m.DistributionStartBlock.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintIncentive(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.EdenAmountPerYear.Size() - i -= size - if _, err := m.EdenAmountPerYear.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintIncentive(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + // 299 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0x4f, 0x4a, 0xc3, 0x40, + 0x14, 0xc6, 0x33, 0x0a, 0x82, 0x81, 0x2e, 0x1a, 0x2a, 0xd4, 0x82, 0x69, 0x71, 0x55, 0x90, 0x64, + 0x16, 0x9e, 0xc0, 0x22, 0x48, 0x76, 0xd2, 0x9d, 0x22, 0x84, 0xfc, 0x79, 0x4d, 0x87, 0x74, 0xe6, + 0x85, 0x99, 0x17, 0xb5, 0xb7, 0xf0, 0x00, 0x1e, 0xc3, 0x43, 0x74, 0x59, 0x5c, 0x89, 0x8b, 0x22, + 0xed, 0x45, 0x24, 0x99, 0x96, 0xee, 0xe6, 0xe3, 0xf7, 0xde, 0x6f, 0x78, 0x9f, 0x7b, 0x05, 0x8b, + 0xa5, 0xe1, 0x60, 0x28, 0x29, 0x85, 0x2a, 0xb8, 0x50, 0x19, 0x28, 0x12, 0xaf, 0x10, 0x56, 0x1a, + 0x09, 0xbd, 0x4e, 0x83, 0xc3, 0x03, 0x1e, 0xf4, 0x0a, 0x2c, 0xb0, 0x25, 0xbc, 0x79, 0xd9, 0xa1, + 0xc1, 0xb0, 0x40, 0x2c, 0x16, 0xc0, 0xdb, 0x94, 0xd6, 0x33, 0x4e, 0x42, 0x36, 0x2b, 0xb2, 0xda, + 0x0f, 0x5c, 0x66, 0x68, 0x24, 0x9a, 0xd8, 0x6e, 0xda, 0x60, 0xd1, 0xf5, 0x27, 0x73, 0x3b, 0xd1, + 0xe1, 0xd3, 0x48, 0xcd, 0xd0, 0x7b, 0x71, 0x7b, 0x90, 0x83, 0x8a, 0x13, 0x89, 0xb5, 0xa2, 0xb8, + 0x02, 0x1d, 0x2f, 0x21, 0xd1, 0x7d, 0x36, 0x62, 0xe3, 0xf3, 0xc9, 0xcd, 0x6a, 0x33, 0x74, 0x7e, + 0x37, 0xc3, 0x0b, 0x6b, 0x31, 0x79, 0x19, 0x0a, 0xe4, 0x32, 0xa1, 0x79, 0x18, 0x29, 0xfa, 0xfe, + 0x0a, 0xdc, 0xbd, 0x3e, 0x52, 0x34, 0xed, 0x36, 0xa2, 0xbb, 0xd6, 0xf3, 0x08, 0xfa, 0x09, 0x12, + 0xed, 0x05, 0xae, 0x97, 0x2e, 0x30, 0x2b, 0x4d, 0x9c, 0x0b, 0x43, 0x5a, 0xa4, 0x35, 0x41, 0xde, + 0x3f, 0x19, 0xb1, 0xf1, 0xe9, 0xb4, 0x6b, 0xc9, 0xfd, 0x11, 0x4c, 0x1e, 0x56, 0x5b, 0x9f, 0xad, + 0xb7, 0x3e, 0xfb, 0xdb, 0xfa, 0xec, 0x63, 0xe7, 0x3b, 0xeb, 0x9d, 0xef, 0xfc, 0xec, 0x7c, 0xe7, + 0x39, 0x28, 0x04, 0xcd, 0xeb, 0x34, 0xcc, 0x50, 0xf2, 0xa6, 0xa4, 0x40, 0x01, 0xbd, 0xa1, 0x2e, + 0xdb, 0xc0, 0xdf, 0x8f, 0x95, 0xd2, 0xb2, 0x02, 0x93, 0x9e, 0xb5, 0xe7, 0xde, 0xfe, 0x07, 0x00, + 0x00, 0xff, 0xff, 0xf6, 0xa9, 0x53, 0xa9, 0x70, 0x01, 0x00, 0x00, } func (m *IncentiveInfo) Marshal() (dAtA []byte, err error) { @@ -265,23 +151,6 @@ func encodeVarintIncentive(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *LegacyIncentiveInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.EdenAmountPerYear.Size() - n += 1 + l + sovIncentive(uint64(l)) - l = m.DistributionStartBlock.Size() - n += 1 + l + sovIncentive(uint64(l)) - l = m.TotalBlocksPerYear.Size() - n += 1 + l + sovIncentive(uint64(l)) - l = m.BlocksDistributed.Size() - n += 1 + l + sovIncentive(uint64(l)) - return n -} - func (m *IncentiveInfo) Size() (n int) { if m == nil { return 0 @@ -302,192 +171,6 @@ func sovIncentive(x uint64) (n int) { func sozIncentive(x uint64) (n int) { return sovIncentive(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *LegacyIncentiveInfo) 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 ErrIntOverflowIncentive - } - 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: LegacyIncentiveInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LegacyIncentiveInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EdenAmountPerYear", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentive - } - 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 ErrInvalidLengthIncentive - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthIncentive - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.EdenAmountPerYear.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionStartBlock", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentive - } - 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 ErrInvalidLengthIncentive - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthIncentive - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DistributionStartBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalBlocksPerYear", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentive - } - 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 ErrInvalidLengthIncentive - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthIncentive - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TotalBlocksPerYear.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksDistributed", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentive - } - 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 ErrInvalidLengthIncentive - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthIncentive - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlocksDistributed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIncentive(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthIncentive - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *IncentiveInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/estaking/types/params.go b/x/estaking/types/params.go index 15af2e517..f0109063c 100644 --- a/x/estaking/types/params.go +++ b/x/estaking/types/params.go @@ -1,12 +1,12 @@ package types import ( + "fmt" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - "fmt" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "gopkg.in/yaml.v2" ) // DefaultParams returns a default set of parameters @@ -63,8 +63,3 @@ func (p Params) Validate() error { } return nil } - -func (p LegacyParams) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} diff --git a/x/estaking/types/params.pb.go b/x/estaking/types/params.pb.go index da608a397..ad7ad885d 100644 --- a/x/estaking/types/params.pb.go +++ b/x/estaking/types/params.pb.go @@ -25,77 +25,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type LegacyParams struct { - StakeIncentives *LegacyIncentiveInfo `protobuf:"bytes,1,opt,name=stake_incentives,json=stakeIncentives,proto3" json:"stake_incentives,omitempty"` - EdenCommitVal string `protobuf:"bytes,2,opt,name=eden_commit_val,json=edenCommitVal,proto3" json:"eden_commit_val,omitempty"` - EdenbCommitVal string `protobuf:"bytes,3,opt,name=edenb_commit_val,json=edenbCommitVal,proto3" json:"edenb_commit_val,omitempty"` - // Maximum eden reward apr for stakers - [0 - 0.3] - MaxEdenRewardAprStakers cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=max_eden_reward_apr_stakers,json=maxEdenRewardAprStakers,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_eden_reward_apr_stakers"` - EdenBoostApr cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=eden_boost_apr,json=edenBoostApr,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"eden_boost_apr"` - // Tracking dex rewards given to stakers - DexRewardsStakers LegacyDexRewardsTracker `protobuf:"bytes,7,opt,name=dex_rewards_stakers,json=dexRewardsStakers,proto3" json:"dex_rewards_stakers"` -} - -func (m *LegacyParams) Reset() { *m = LegacyParams{} } -func (*LegacyParams) ProtoMessage() {} -func (*LegacyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_66041162e1ecb63b, []int{0} -} -func (m *LegacyParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LegacyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LegacyParams.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 *LegacyParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_LegacyParams.Merge(m, src) -} -func (m *LegacyParams) XXX_Size() int { - return m.Size() -} -func (m *LegacyParams) XXX_DiscardUnknown() { - xxx_messageInfo_LegacyParams.DiscardUnknown(m) -} - -var xxx_messageInfo_LegacyParams proto.InternalMessageInfo - -func (m *LegacyParams) GetStakeIncentives() *LegacyIncentiveInfo { - if m != nil { - return m.StakeIncentives - } - return nil -} - -func (m *LegacyParams) GetEdenCommitVal() string { - if m != nil { - return m.EdenCommitVal - } - return "" -} - -func (m *LegacyParams) GetEdenbCommitVal() string { - if m != nil { - return m.EdenbCommitVal - } - return "" -} - -func (m *LegacyParams) GetDexRewardsStakers() LegacyDexRewardsTracker { - if m != nil { - return m.DexRewardsStakers - } - return LegacyDexRewardsTracker{} -} - // Params defines the parameters for the module. type Params struct { StakeIncentives *IncentiveInfo `protobuf:"bytes,1,opt,name=stake_incentives,json=stakeIncentives,proto3" json:"stake_incentives,omitempty"` @@ -112,7 +41,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_66041162e1ecb63b, []int{1} + return fileDescriptor_66041162e1ecb63b, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -170,123 +99,40 @@ func (m *Params) GetDexRewardsStakers() DexRewardsTracker { } func init() { - proto.RegisterType((*LegacyParams)(nil), "elys.estaking.LegacyParams") proto.RegisterType((*Params)(nil), "elys.estaking.Params") } func init() { proto.RegisterFile("elys/estaking/params.proto", fileDescriptor_66041162e1ecb63b) } var fileDescriptor_66041162e1ecb63b = []byte{ - // 480 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x41, 0x6b, 0x13, 0x41, - 0x18, 0xdd, 0x35, 0x69, 0xc4, 0xb1, 0xb5, 0x75, 0x15, 0x8c, 0xa9, 0x6e, 0x42, 0x0e, 0x35, 0x97, - 0xec, 0xa2, 0xde, 0xbc, 0x35, 0x46, 0x4a, 0x41, 0x41, 0x56, 0xa9, 0x20, 0xc2, 0x30, 0x99, 0xfd, - 0xdc, 0x2e, 0x9b, 0xd9, 0x59, 0x66, 0xc6, 0x76, 0xf3, 0x2f, 0x3c, 0x7a, 0xf4, 0x47, 0xf8, 0x17, - 0x84, 0x1e, 0x8b, 0x27, 0x11, 0x2c, 0x92, 0xfc, 0x11, 0x99, 0x99, 0x4d, 0xda, 0x94, 0x0a, 0x22, - 0x22, 0xde, 0x32, 0xdf, 0x7b, 0xf3, 0xde, 0x9b, 0xef, 0x91, 0x45, 0x2d, 0x18, 0x4f, 0x64, 0x08, - 0x52, 0x91, 0x2c, 0xcd, 0x93, 0xb0, 0x20, 0x82, 0x30, 0x19, 0x14, 0x82, 0x2b, 0xee, 0xad, 0x69, - 0x2c, 0x98, 0x63, 0xad, 0x9b, 0x09, 0x4f, 0xb8, 0x41, 0x42, 0xfd, 0xcb, 0x92, 0x5a, 0x77, 0x97, - 0x05, 0xd2, 0x9c, 0x42, 0xae, 0xd2, 0x03, 0xa8, 0xe0, 0x7b, 0xcb, 0x70, 0x0c, 0x25, 0x16, 0x70, - 0x48, 0x44, 0x2c, 0xb1, 0x12, 0x84, 0x66, 0x20, 0x2a, 0xe2, 0x6d, 0xca, 0x25, 0xe3, 0x12, 0x5b, - 0x03, 0x7b, 0xb0, 0x50, 0xf7, 0x7b, 0x0d, 0xad, 0x3e, 0x85, 0x84, 0xd0, 0xc9, 0x73, 0x13, 0xcf, - 0x7b, 0x86, 0x36, 0xb4, 0x20, 0xe0, 0x85, 0x9b, 0x6c, 0xba, 0x1d, 0xb7, 0x77, 0xf5, 0x41, 0x37, - 0x58, 0xca, 0x1c, 0xd8, 0x6b, 0xbb, 0x73, 0xda, 0x6e, 0xfe, 0x96, 0x47, 0xeb, 0xe6, 0xee, 0x62, - 0x26, 0xbd, 0x2d, 0xb4, 0x0e, 0x31, 0xe4, 0x98, 0x72, 0xc6, 0x52, 0x85, 0x0f, 0xc8, 0xb8, 0x79, - 0xa9, 0xe3, 0xf6, 0xae, 0x44, 0x6b, 0x7a, 0xfc, 0xd8, 0x4c, 0xf7, 0xc8, 0xd8, 0xeb, 0xa1, 0x0d, - 0x3d, 0x18, 0x9d, 0x25, 0xd6, 0x0c, 0xf1, 0x9a, 0x99, 0x9f, 0x32, 0x39, 0x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e7, 0x75, 0x3f, 0x49, 0xd5, 0xfe, 0xbb, 0x51, 0x40, 0x39, 0x0b, 0xb5, 0x7c, 0x3f, 0x07, - 0x75, 0xc8, 0x45, 0x66, 0x0e, 0x61, 0x79, 0xfa, 0x7d, 0x50, 0x93, 0x02, 0xe4, 0xa8, 0x61, 0xfe, - 0xf7, 0x0f, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0x11, 0xc0, 0x76, 0x82, 0x9d, 0x04, 0x00, 0x00, -} - -func (m *LegacyParams) 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 *LegacyParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LegacyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.DexRewardsStakers.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size := m.EdenBoostApr.Size() - i -= size - if _, err := m.EdenBoostApr.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.MaxEdenRewardAprStakers.Size() - i -= size - if _, err := m.MaxEdenRewardAprStakers.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.EdenbCommitVal) > 0 { - i -= len(m.EdenbCommitVal) - copy(dAtA[i:], m.EdenbCommitVal) - i = encodeVarintParams(dAtA, i, uint64(len(m.EdenbCommitVal))) - i-- - dAtA[i] = 0x1a - } - if len(m.EdenCommitVal) > 0 { - i -= len(m.EdenCommitVal) - copy(dAtA[i:], m.EdenCommitVal) - i = encodeVarintParams(dAtA, i, uint64(len(m.EdenCommitVal))) - i-- - dAtA[i] = 0x12 - } - if m.StakeIncentives != nil { - { - size, err := m.StakeIncentives.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0xcd, 0x8e, 0xd3, 0x30, + 0x18, 0x4c, 0xd8, 0xa5, 0x12, 0x86, 0x65, 0x97, 0x80, 0x44, 0xe8, 0x42, 0xb6, 0xe2, 0x00, 0xbd, + 0x34, 0x11, 0xf0, 0x04, 0x1b, 0x8a, 0x56, 0x2b, 0x71, 0x40, 0x01, 0x2d, 0x12, 0x17, 0xcb, 0x71, + 0x3e, 0xb2, 0x51, 0xea, 0x38, 0xb2, 0x4d, 0x9b, 0xbe, 0x05, 0x0f, 0xc3, 0x2b, 0x20, 0xf5, 0x58, + 0x71, 0x42, 0x1c, 0x2a, 0xd4, 0xbe, 0x08, 0xb2, 0x9d, 0xfe, 0x71, 0xdc, 0x9b, 0x3d, 0x33, 0x9e, + 0x99, 0xcf, 0x36, 0xea, 0xc2, 0x68, 0x2a, 0x23, 0x90, 0x8a, 0x94, 0x45, 0x95, 0x47, 0x35, 0x11, + 0x84, 0xc9, 0xb0, 0x16, 0x5c, 0x71, 0xef, 0x48, 0x73, 0xe1, 0x9a, 0xeb, 0x3e, 0xca, 0x79, 0xce, + 0x0d, 0x13, 0xe9, 0x95, 0x15, 0x75, 0x9f, 0xed, 0x1b, 0x14, 0x15, 0x85, 0x4a, 0x15, 0x63, 0x68, + 0xe9, 0x97, 0xfb, 0x74, 0x06, 0x0d, 0x16, 0x30, 0x21, 0x22, 0x93, 0x58, 0x09, 0x42, 0x4b, 0x10, + 0xad, 0xf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 0x70, 0xf7, 0x9d, 0xd6, 0x13, 0x74, 0xcc, 0x3d, 0xf7, + 0xfe, 0xbb, 0xe7, 0x21, 0x34, 0xb6, 0x99, 0xfc, 0x64, 0xdf, 0x33, 0x3e, 0xd4, 0xf9, 0xc9, 0x83, + 0x6c, 0x43, 0xb4, 0x85, 0xe3, 0x8b, 0xd9, 0x32, 0x70, 0xe7, 0xcb, 0xc0, 0xfd, 0xbb, 0x0c, 0xdc, + 0xef, 0xab, 0xc0, 0x99, 0xaf, 0x02, 0xe7, 0xf7, 0x2a, 0x70, 0xbe, 0x0c, 0xf2, 0x42, 0x5d, 0x7f, + 0x4b, 0x43, 0xca, 0x59, 0xa4, 0xed, 0x07, 0x15, 0xa8, 0x09, 0x17, 0xa5, 0xd9, 0x44, 0xcd, 0xf6, + 0xff, 0xa8, 0x69, 0x0d, 0x32, 0xed, 0x98, 0x7f, 0xf1, 0xe6, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x80, 0x80, 0x2a, 0x52, 0xbd, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -379,33 +225,6 @@ func encodeVarintParams(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *LegacyParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StakeIncentives != nil { - l = m.StakeIncentives.Size() - n += 1 + l + sovParams(uint64(l)) - } - l = len(m.EdenCommitVal) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - l = len(m.EdenbCommitVal) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - l = m.MaxEdenRewardAprStakers.Size() - n += 1 + l + sovParams(uint64(l)) - l = m.EdenBoostApr.Size() - n += 1 + l + sovParams(uint64(l)) - l = m.DexRewardsStakers.Size() - n += 1 + l + sovParams(uint64(l)) - return n -} - func (m *Params) Size() (n int) { if m == nil { return 0 @@ -439,257 +258,6 @@ func sovParams(x uint64) (n int) { func sozParams(x uint64) (n int) { return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *LegacyParams) 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 ErrIntOverflowParams - } - 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: LegacyParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LegacyParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeIncentives", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.StakeIncentives == nil { - m.StakeIncentives = &LegacyIncentiveInfo{} - } - if err := m.StakeIncentives.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EdenCommitVal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EdenCommitVal = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EdenbCommitVal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EdenbCommitVal = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxEdenRewardAprStakers", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MaxEdenRewardAprStakers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EdenBoostApr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.EdenBoostApr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DexRewardsStakers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DexRewardsStakers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From f8a8f7f5f3cf62ad6d70c78019314d688f81a8e2 Mon Sep 17 00:00:00 2001 From: Adarsh Kumar Date: Tue, 3 Dec 2024 09:27:51 +0530 Subject: [PATCH 3/3] fix tradeshield execute-order cli (#1013) Co-authored-by: Amit Yadav --- x/tradeshield/client/cli/tx_execute_orders.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/tradeshield/client/cli/tx_execute_orders.go b/x/tradeshield/client/cli/tx_execute_orders.go index a63ed85ae..844178c61 100644 --- a/x/tradeshield/client/cli/tx_execute_orders.go +++ b/x/tradeshield/client/cli/tx_execute_orders.go @@ -22,6 +22,9 @@ func CmdExecuteOrders() *cobra.Command { Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) (err error) { argCastSpotOrderIds := strings.Split(args[0], listSeparator) + if len(argCastSpotOrderIds) == 1 && argCastSpotOrderIds[0] == "" { + argCastSpotOrderIds = []string{} + } argSpotOrderIds := make([]uint64, len(argCastSpotOrderIds)) for i, arg := range argCastSpotOrderIds { value, err := cast.ToUint64E(arg) @@ -31,6 +34,9 @@ func CmdExecuteOrders() *cobra.Command { argSpotOrderIds[i] = value } argCastPerpetualOrderIds := strings.Split(args[1], listSeparator) + if len(argCastPerpetualOrderIds) == 1 && argCastPerpetualOrderIds[0] == "" { + argCastPerpetualOrderIds = []string{} + } argPerpetualOrderIds := make([]uint64, len(argCastPerpetualOrderIds)) for i, arg := range argCastPerpetualOrderIds { value, err := cast.ToUint64E(arg)