From 2dc03ff894bb629f8fe0b0cae54e02ec5d1de940 Mon Sep 17 00:00:00 2001 From: Tim Lind Date: Mon, 2 May 2022 13:41:20 +0200 Subject: [PATCH 1/3] cancel-unbond tx --- proto/sifnode/clp/v1/tx.proto | 15 +- x/clp/client/cli/tx.go | 44 ++- x/clp/keeper/msg_server.go | 47 ++- x/clp/types/msgs.go | 32 ++ x/clp/types/querier.pb.gw.go | 34 +- x/clp/types/tx.pb.go | 604 +++++++++++++++++++++++++++++----- 6 files changed, 680 insertions(+), 96 deletions(-) diff --git a/proto/sifnode/clp/v1/tx.proto b/proto/sifnode/clp/v1/tx.proto index 4d593601bb..f32be08cab 100644 --- a/proto/sifnode/clp/v1/tx.proto +++ b/proto/sifnode/clp/v1/tx.proto @@ -21,6 +21,7 @@ service Msg { rpc ModifyPmtpRates(MsgModifyPmtpRates) returns (MsgModifyPmtpRatesResponse); rpc UpdatePmtpParams(MsgUpdatePmtpParams) returns (MsgUpdatePmtpParamsResponse); rpc UpdateStakingRewardParams(MsgUpdateStakingRewardParams) returns (MsgUpdateStakingRewardParamsResponse); + rpc CancelUnlockLiquidity(MsgCancelUnlock) returns (MsgCancelUnlockResponse); } //message MsgUpdateStakingRewardParams{ @@ -198,4 +199,16 @@ message MsgAddRewardPeriodRequest { repeated RewardPeriod reward_periods = 2; } -message MsgAddRewardPeriodResponse {} \ No newline at end of file +message MsgAddRewardPeriodResponse {} + +message MsgCancelUnlock { + string signer = 1; + sifnode.clp.v1.Asset external_asset = 2 + [ (gogoproto.moretags) = "yaml:\"external_asset\"" ]; + string units = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; +} + +message MsgCancelUnlockResponse {} \ No newline at end of file diff --git a/x/clp/client/cli/tx.go b/x/clp/client/cli/tx.go index 4cca0d88dd..0270f100f7 100644 --- a/x/clp/client/cli/tx.go +++ b/x/clp/client/cli/tx.go @@ -3,10 +3,11 @@ package cli import ( "encoding/json" "fmt" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "io/ioutil" "path/filepath" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "log" "github.com/Sifchain/sifnode/x/clp/types" @@ -36,6 +37,7 @@ func GetTxCmd() *cobra.Command { GetCmdSwap(), GetCmdDecommissionPool(), GetCmdUnlockLiquidity(), + GetCmdCancelUnlockLiquidity(), GetCmdUpdateRewardParams(), GetCmdAddRewardPeriod(), GetCmdModifyPmtpRates(), @@ -548,3 +550,43 @@ func GetCmdUnlockLiquidity() *cobra.Command { return cmd } + +func GetCmdCancelUnlockLiquidity() *cobra.Command { + cmd := &cobra.Command{ + Use: "cancel-unbond", + Short: "Cancel unbonding of liquidity from a pool", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + externalAsset := types.NewAsset(viper.GetString(FlagAssetSymbol)) + signer := clientCtx.GetFromAddress() + units := viper.GetUint64(FlagUnits) + unitsInt := sdk.NewUint(units) + msg := types.MsgCancelUnlock{ + Signer: signer.String(), + ExternalAsset: &externalAsset, + Units: unitsInt, + } + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + cmd.Flags().AddFlagSet(FsAssetSymbol) + cmd.Flags().AddFlagSet(FsUnits) + if err := cmd.MarkFlagRequired(FlagAssetSymbol); err != nil { + log.Println("MarkFlagRequired failed: ", err.Error()) + } + if err := cmd.MarkFlagRequired(FlagUnits); err != nil { + log.Println("MarkFlagRequired failed: ", err.Error()) + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/clp/keeper/msg_server.go b/x/clp/keeper/msg_server.go index a78b6fd8f4..33bccf68db 100644 --- a/x/clp/keeper/msg_server.go +++ b/x/clp/keeper/msg_server.go @@ -22,6 +22,45 @@ type msgServer struct { Keeper } +// NewMsgServerImpl returns an implementation of the clp MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) CancelUnlockLiquidity(goCtx context.Context, request *types.MsgCancelUnlock) (*types.MsgCancelUnlockResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + lp, err := k.Keeper.GetLiquidityProvider(ctx, request.ExternalAsset.Symbol, request.Signer) + if err != nil { + return nil, types.ErrLiquidityProviderDoesNotExist + } + // Prune unlocks + params := k.GetRewardsParams(ctx) + k.PruneUnlockRecords(ctx, &lp, params.LiquidityRemovalLockPeriod, params.LiquidityRemovalCancelPeriod) + + err = k.UseUnlockedLiquidity(ctx, lp, request.Units) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeCancelUnlock, + sdk.NewAttribute(types.AttributeKeyLiquidityProvider, lp.String()), + sdk.NewAttribute(types.AttributeKeyPool, lp.Asset.Symbol), + sdk.NewAttribute(types.AttributeKeyUnits, request.Units.String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, request.Signer), + ), + }) + return &types.MsgCancelUnlockResponse{}, nil +} + func (k msgServer) UpdateStakingRewardParams(goCtx context.Context, msg *types.MsgUpdateStakingRewardParams) (*types.MsgUpdateStakingRewardParamsResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -73,14 +112,6 @@ func (k msgServer) AddRewardPeriod(goCtx context.Context, msg *types.MsgAddRewar return response, nil } -// NewMsgServerImpl returns an implementation of the clp MsgServer interface -// for the provided Keeper. -func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{Keeper: keeper} -} - -var _ types.MsgServer = msgServer{} - func (k msgServer) UpdatePmtpParams(goCtx context.Context, msg *types.MsgUpdatePmtpParams) (*types.MsgUpdatePmtpParamsResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) response := &types.MsgUpdatePmtpParamsResponse{} diff --git a/x/clp/types/msgs.go b/x/clp/types/msgs.go index 096f3cb24d..75d6f24eeb 100644 --- a/x/clp/types/msgs.go +++ b/x/clp/types/msgs.go @@ -22,6 +22,7 @@ var ( _ sdk.Msg = &MsgModifyPmtpRates{} _ sdk.Msg = &MsgUpdatePmtpParams{} _ sdk.Msg = &MsgUpdateStakingRewardParams{} + _ sdk.Msg = &MsgCancelUnlock{} _ legacytx.LegacyMsg = &MsgRemoveLiquidity{} _ legacytx.LegacyMsg = &MsgRemoveLiquidityUnits{} @@ -35,8 +36,39 @@ var ( _ legacytx.LegacyMsg = &MsgModifyPmtpRates{} _ legacytx.LegacyMsg = &MsgUpdatePmtpParams{} _ legacytx.LegacyMsg = &MsgUpdateStakingRewardParams{} + _ legacytx.LegacyMsg = &MsgCancelUnlock{} ) +func (m MsgCancelUnlock) Route() string { + return RouterKey +} + +func (m MsgCancelUnlock) Type() string { + return "cancel_unlock" +} + +func (m MsgCancelUnlock) ValidateBasic() error { + if len(m.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, m.Signer) + } + if !m.ExternalAsset.Validate() { + return sdkerrors.Wrap(ErrInValidAsset, m.ExternalAsset.Symbol) + } + return nil +} + +func (m MsgCancelUnlock) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +func (m MsgCancelUnlock) GetSigners() []sdk.AccAddress { + addr, err := sdk.AccAddressFromBech32(m.Signer) + if err != nil { + panic(err) + } + return []sdk.AccAddress{addr} +} + func (m MsgUpdateStakingRewardParams) Route() string { return RouterKey } diff --git a/x/clp/types/querier.pb.gw.go b/x/clp/types/querier.pb.gw.go index 81e095b882..56eabdd9b7 100644 --- a/x/clp/types/querier.pb.gw.go +++ b/x/clp/types/querier.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Query_GetPool_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq PoolReq @@ -506,12 +508,14 @@ func local_request_Query_GetPmtpParams_0(ctx context.Context, marshaler runtime. // 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. -// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_GetPool_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 { @@ -519,6 +523,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetPool_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) @@ -532,6 +537,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetPools_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 { @@ -539,6 +546,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetPools_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) @@ -552,6 +560,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetLiquidityProvider_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 { @@ -559,6 +569,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetLiquidityProvider_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) @@ -572,6 +583,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetLiquidityProviderData_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 { @@ -579,6 +592,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetLiquidityProviderData_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) @@ -592,6 +606,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetAssetList_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 { @@ -599,6 +615,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetAssetList_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) @@ -612,6 +629,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetLiquidityProviders_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 { @@ -619,6 +638,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetLiquidityProviders_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) @@ -632,6 +652,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetLiquidityProviderList_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 { @@ -639,6 +661,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetLiquidityProviderList_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) @@ -652,6 +675,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetParams_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 { @@ -659,6 +684,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetParams_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) @@ -672,6 +698,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetRewardParams_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 { @@ -679,6 +707,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetRewardParams_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) @@ -692,6 +721,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetPmtpParams_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 { @@ -699,6 +730,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetPmtpParams_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) diff --git a/x/clp/types/tx.pb.go b/x/clp/types/tx.pb.go index 35be1ac01f..b4dbb095c2 100644 --- a/x/clp/types/tx.pb.go +++ b/x/clp/types/tx.pb.go @@ -1146,6 +1146,95 @@ func (m *MsgAddRewardPeriodResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddRewardPeriodResponse proto.InternalMessageInfo +type MsgCancelUnlock struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + ExternalAsset *Asset `protobuf:"bytes,2,opt,name=external_asset,json=externalAsset,proto3" json:"external_asset,omitempty" yaml:"external_asset"` + Units github_com_cosmos_cosmos_sdk_types.Uint `protobuf:"bytes,3,opt,name=units,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Uint" json:"units"` +} + +func (m *MsgCancelUnlock) Reset() { *m = MsgCancelUnlock{} } +func (m *MsgCancelUnlock) String() string { return proto.CompactTextString(m) } +func (*MsgCancelUnlock) ProtoMessage() {} +func (*MsgCancelUnlock) Descriptor() ([]byte, []int) { + return fileDescriptor_a3bff5b30808c4f3, []int{24} +} +func (m *MsgCancelUnlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelUnlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelUnlock.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 *MsgCancelUnlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelUnlock.Merge(m, src) +} +func (m *MsgCancelUnlock) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelUnlock) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelUnlock.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelUnlock proto.InternalMessageInfo + +func (m *MsgCancelUnlock) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgCancelUnlock) GetExternalAsset() *Asset { + if m != nil { + return m.ExternalAsset + } + return nil +} + +type MsgCancelUnlockResponse struct { +} + +func (m *MsgCancelUnlockResponse) Reset() { *m = MsgCancelUnlockResponse{} } +func (m *MsgCancelUnlockResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCancelUnlockResponse) ProtoMessage() {} +func (*MsgCancelUnlockResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a3bff5b30808c4f3, []int{25} +} +func (m *MsgCancelUnlockResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelUnlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelUnlockResponse.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 *MsgCancelUnlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelUnlockResponse.Merge(m, src) +} +func (m *MsgCancelUnlockResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelUnlockResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelUnlockResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelUnlockResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateStakingRewardParams)(nil), "sifnode.clp.v1.MsgUpdateStakingRewardParams") proto.RegisterType((*MsgUpdateStakingRewardParamsResponse)(nil), "sifnode.clp.v1.MsgUpdateStakingRewardParamsResponse") @@ -1171,96 +1260,100 @@ func init() { proto.RegisterType((*MsgUpdateRewardsParamsResponse)(nil), "sifnode.clp.v1.MsgUpdateRewardsParamsResponse") proto.RegisterType((*MsgAddRewardPeriodRequest)(nil), "sifnode.clp.v1.MsgAddRewardPeriodRequest") proto.RegisterType((*MsgAddRewardPeriodResponse)(nil), "sifnode.clp.v1.MsgAddRewardPeriodResponse") + proto.RegisterType((*MsgCancelUnlock)(nil), "sifnode.clp.v1.MsgCancelUnlock") + proto.RegisterType((*MsgCancelUnlockResponse)(nil), "sifnode.clp.v1.MsgCancelUnlockResponse") } func init() { proto.RegisterFile("sifnode/clp/v1/tx.proto", fileDescriptor_a3bff5b30808c4f3) } var fileDescriptor_a3bff5b30808c4f3 = []byte{ - // 1337 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x6f, 0xdc, 0xc4, - 0x17, 0xcf, 0x66, 0xdb, 0x7e, 0xbf, 0x79, 0x69, 0xd2, 0xc6, 0xc9, 0x2a, 0x1b, 0x27, 0xd9, 0x6d, - 0x5d, 0xe8, 0x0f, 0xa0, 0xbb, 0xb4, 0x80, 0x40, 0x48, 0x48, 0x24, 0x25, 0x2a, 0x88, 0x2e, 0xac, - 0x1c, 0x55, 0x45, 0x5c, 0x8c, 0xb3, 0x9e, 0x38, 0xa3, 0xd8, 0x33, 0xae, 0x67, 0xf2, 0x63, 0x0f, - 0x08, 0x24, 0x8e, 0x48, 0x88, 0x23, 0xe2, 0x84, 0xf8, 0x5b, 0x40, 0xea, 0xb1, 0x07, 0x0e, 0x88, - 0x43, 0x84, 0x5a, 0x09, 0x89, 0x03, 0x97, 0xfe, 0x05, 0x68, 0x7e, 0xd8, 0xeb, 0xf5, 0x7a, 0x9b, - 0xb8, 0xa7, 0x1c, 0x38, 0xed, 0x7a, 0xde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9f, 0x19, 0x37, 0x8b, - 0x28, 0xc6, 0x4e, 0x19, 0xb3, 0x75, 0x52, 0xf8, 0x20, 0xbe, 0x5c, 0xb7, 0x14, 0xc6, 0x57, 0xdc, - 0xde, 0x85, 0xf1, 0x8d, 0x69, 0x3e, 0xd1, 0x74, 0xf9, 0x0b, 0x69, 0x51, 0xd3, 0xe5, 0x30, 0x85, - 0x26, 0xc6, 0x5c, 0x1b, 0xc5, 0x96, 0x18, 0xb9, 0x32, 0x5e, 0x19, 0x9b, 0x90, 0x01, 0xa8, 0x70, - 0x4b, 0x8c, 0xbb, 0x58, 0x19, 0x5f, 0xc1, 0xd2, 0xf8, 0x6f, 0x53, 0xaf, 0x8d, 0x65, 0x2a, 0x40, - 0x9b, 0x6f, 0x96, 0x41, 0x27, 0x0e, 0xac, 0xaf, 0x3d, 0x7a, 0xd2, 0xa8, 0x3c, 0x7e, 0xd2, 0xa8, - 0xfc, 0xf9, 0xa4, 0x51, 0xf9, 0xfe, 0x69, 0x63, 0xe2, 0xf1, 0xd3, 0xc6, 0xc4, 0xef, 0x4f, 0x1b, - 0x13, 0x9f, 0x67, 0xcf, 0xb4, 0x4d, 0xbc, 0xdd, 0xdb, 0x71, 0x31, 0x69, 0x27, 0xdf, 0xda, 0x0e, - 0xe5, 0xd7, 0x36, 0x79, 0xb0, 0x6d, 0x9d, 0x93, 0x9f, 0xda, 0xde, 0xf8, 0x37, 0x00, 0x00, 0xff, - 0xff, 0xad, 0x4d, 0x16, 0x09, 0xe4, 0x13, 0x00, 0x00, + // 1371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcb, 0x6f, 0xdc, 0x44, + 0x18, 0xcf, 0x66, 0xdb, 0x42, 0xbe, 0x34, 0x69, 0xe3, 0x64, 0x49, 0xe2, 0x24, 0xbb, 0xad, 0x0b, + 0x7d, 0x00, 0xdd, 0xa5, 0x05, 0x04, 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xa4, 0xe8, 0x12, 0xd7, 0xdf, 0xea, 0xf7, 0x42, 0x16, + 0x99, 0x36, 0x43, 0x95, 0xa8, 0x69, 0x05, 0x60, 0x33, 0x20, 0xce, 0x8e, 0x15, 0xdb, 0x0c, 0xc9, + 0xb3, 0xd3, 0x9c, 0x10, 0x2b, 0xdc, 0x94, 0x76, 0x11, 0xce, 0xc6, 0xbb, 0x18, 0xfb, 0xd8, 0x93, + 0x00, 0x51, 0x79, 0x73, 0x52, 0xad, 0x09, 0xc8, 0x0a, 0x00, 0xc2, 0xae, 0x15, 0x91, 0xc0, 0x77, + 0x24, 0x49, 0x3f, 0x6f, 0x4e, 0x20, 0xec, 0xf6, 0xc4, 0x82, 0x22, 0xd8, 0x42, 0x84, 0x69, 0x02, + 0x3f, 0x8d, 0xc3, 0x6c, 0x7a, 0x26, 0x72, 0x71, 0xf5, 0x93, 0xff, 0x5d, 0x58, 0x8a, 0x42, 0x16, + 0x59, 0x11, 0x8a, 0x7d, 0xe2, 0x5a, 0x1e, 0xd9, 0xe3, 0x15, 0xc4, 0x0e, 0xca, 0xa6, 0xb4, 0xc0, + 0x21, 0x3d, 0x81, 0xb8, 0x9d, 0x02, 0x44, 0xf8, 0x6f, 0xc1, 0x42, 0x56, 0x1d, 0x45, 0xc4, 0xd9, + 0xb6, 0x02, 0x84, 0x3d, 0xb6, 0x2d, 0xb2, 0xad, 0x9b, 0x8d, 0x81, 0xee, 0x3a, 0x97, 0xde, 0x11, + 0x42, 0xed, 0x4d, 0x98, 0xcf, 0x2a, 0x52, 0x66, 0xc7, 0xcc, 0x12, 0x95, 0x13, 0x45, 0xa8, 0x9b, + 0x73, 0x03, 0xbd, 0x0d, 0x2e, 0x5c, 0xe3, 0x32, 0xed, 0x06, 0x34, 0x72, 0xfe, 0xb0, 0xab, 0x94, + 0x4e, 0x0b, 0x25, 0x2d, 0xe3, 0x0c, 0xbb, 0x42, 0xc5, 0x58, 0x81, 0xa5, 0x92, 0x1a, 0xa5, 0x35,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, 0xf6, 0xe7, 0xa3, 0x66, 0xed, 0xbb, 0xc7, 0xcd, 0xb1, 0x87, 0x8f, 0x9b, 0x63, 0xbf, + 0x3f, 0x6e, 0x8e, 0x7d, 0x96, 0xa5, 0xe3, 0x0d, 0x7f, 0xcb, 0xd9, 0xb6, 0x7d, 0xdc, 0x49, 0xbe, + 0x5a, 0x1e, 0x88, 0xef, 0x96, 0x82, 0x93, 0x37, 0xcf, 0x88, 0x8f, 0x96, 0xaf, 0xff, 0x1b, 0x00, + 0x00, 0xff, 0xff, 0xc5, 0x35, 0x58, 0x83, 0x2e, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1287,6 +1380,7 @@ type MsgClient interface { ModifyPmtpRates(ctx context.Context, in *MsgModifyPmtpRates, opts ...grpc.CallOption) (*MsgModifyPmtpRatesResponse, error) UpdatePmtpParams(ctx context.Context, in *MsgUpdatePmtpParams, opts ...grpc.CallOption) (*MsgUpdatePmtpParamsResponse, error) UpdateStakingRewardParams(ctx context.Context, in *MsgUpdateStakingRewardParams, opts ...grpc.CallOption) (*MsgUpdateStakingRewardParamsResponse, error) + CancelUnlockLiquidity(ctx context.Context, in *MsgCancelUnlock, opts ...grpc.CallOption) (*MsgCancelUnlockResponse, error) } type msgClient struct { @@ -1405,6 +1499,15 @@ func (c *msgClient) UpdateStakingRewardParams(ctx context.Context, in *MsgUpdate return out, nil } +func (c *msgClient) CancelUnlockLiquidity(ctx context.Context, in *MsgCancelUnlock, opts ...grpc.CallOption) (*MsgCancelUnlockResponse, error) { + out := new(MsgCancelUnlockResponse) + err := c.cc.Invoke(ctx, "/sifnode.clp.v1.Msg/CancelUnlockLiquidity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { RemoveLiquidity(context.Context, *MsgRemoveLiquidity) (*MsgRemoveLiquidityResponse, error) @@ -1419,6 +1522,7 @@ type MsgServer interface { ModifyPmtpRates(context.Context, *MsgModifyPmtpRates) (*MsgModifyPmtpRatesResponse, error) UpdatePmtpParams(context.Context, *MsgUpdatePmtpParams) (*MsgUpdatePmtpParamsResponse, error) UpdateStakingRewardParams(context.Context, *MsgUpdateStakingRewardParams) (*MsgUpdateStakingRewardParamsResponse, error) + CancelUnlockLiquidity(context.Context, *MsgCancelUnlock) (*MsgCancelUnlockResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1461,6 +1565,9 @@ func (*UnimplementedMsgServer) UpdatePmtpParams(ctx context.Context, req *MsgUpd func (*UnimplementedMsgServer) UpdateStakingRewardParams(ctx context.Context, req *MsgUpdateStakingRewardParams) (*MsgUpdateStakingRewardParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateStakingRewardParams not implemented") } +func (*UnimplementedMsgServer) CancelUnlockLiquidity(ctx context.Context, req *MsgCancelUnlock) (*MsgCancelUnlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelUnlockLiquidity not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1682,6 +1789,24 @@ func _Msg_UpdateStakingRewardParams_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _Msg_CancelUnlockLiquidity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelUnlock) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelUnlockLiquidity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sifnode.clp.v1.Msg/CancelUnlockLiquidity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelUnlockLiquidity(ctx, req.(*MsgCancelUnlock)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "sifnode.clp.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -1734,6 +1859,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateStakingRewardParams", Handler: _Msg_UpdateStakingRewardParams_Handler, }, + { + MethodName: "CancelUnlockLiquidity", + Handler: _Msg_CancelUnlockLiquidity_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "sifnode/clp/v1/tx.proto", @@ -2656,6 +2785,81 @@ func (m *MsgAddRewardPeriodResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgCancelUnlock) 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 *MsgCancelUnlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelUnlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Units.Size() + i -= size + if _, err := m.Units.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.ExternalAsset != nil { + { + size, err := m.ExternalAsset.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCancelUnlockResponse) 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 *MsgCancelUnlockResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelUnlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -3023,6 +3227,34 @@ func (m *MsgAddRewardPeriodResponse) Size() (n int) { return n } +func (m *MsgCancelUnlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ExternalAsset != nil { + l = m.ExternalAsset.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = m.Units.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgCancelUnlockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5550,6 +5782,208 @@ func (m *MsgAddRewardPeriodResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgCancelUnlock) 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 ErrIntOverflowTx + } + 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: MsgCancelUnlock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelUnlock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalAsset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExternalAsset == nil { + m.ExternalAsset = &Asset{} + } + if err := m.ExternalAsset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Units", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Units.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelUnlockResponse) 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 ErrIntOverflowTx + } + 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: MsgCancelUnlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelUnlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 2c4a5f331c7f3e9d6b9b5ebc864b0e9981f8f831 Mon Sep 17 00:00:00 2001 From: Tim Lind Date: Mon, 2 May 2022 20:36:52 +0200 Subject: [PATCH 2/3] use unlocks in any state --- x/clp/keeper/msg_server.go | 6 +++--- x/clp/keeper/rewards.go | 4 ++-- x/clp/keeper/rewards_test.go | 16 +++++++++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/x/clp/keeper/msg_server.go b/x/clp/keeper/msg_server.go index a14abfd53b..9a63fc1dd9 100644 --- a/x/clp/keeper/msg_server.go +++ b/x/clp/keeper/msg_server.go @@ -55,7 +55,7 @@ func (k msgServer) CancelUnlockLiquidity(goCtx context.Context, request *types.M params := k.GetRewardsParams(ctx) k.PruneUnlockRecords(ctx, &lp, params.LiquidityRemovalLockPeriod, params.LiquidityRemovalCancelPeriod) - err = k.UseUnlockedLiquidity(ctx, lp, request.Units) + err = k.UseUnlockedLiquidity(ctx, lp, request.Units, true) if err != nil { return nil, err } @@ -524,7 +524,7 @@ func (k msgServer) RemoveLiquidity(goCtx context.Context, msg *types.MsgRemoveLi pool.NativeAssetBalance.String(), pool.ExternalAssetBalance.String(), lp.LiquidityProviderUnits.String(), msg.WBasisPoints.String(), msg.Asymmetry) - err = k.Keeper.UseUnlockedLiquidity(ctx, lp, lp.LiquidityProviderUnits.Sub(lpUnitsLeft)) + err = k.Keeper.UseUnlockedLiquidity(ctx, lp, lp.LiquidityProviderUnits.Sub(lpUnitsLeft), false) if err != nil { return nil, err } @@ -651,7 +651,7 @@ func (k msgServer) RemoveLiquidityUnits(goCtx context.Context, msg *types.MsgRem pool.NativeAssetBalance.String(), pool.ExternalAssetBalance.String(), lp.LiquidityProviderUnits.String(), msg.WithdrawUnits) - err = k.Keeper.UseUnlockedLiquidity(ctx, lp, lp.LiquidityProviderUnits.Sub(lpUnitsLeft)) + err = k.Keeper.UseUnlockedLiquidity(ctx, lp, lp.LiquidityProviderUnits.Sub(lpUnitsLeft), false) if err != nil { return nil, err } diff --git a/x/clp/keeper/rewards.go b/x/clp/keeper/rewards.go index 3b964a2d53..4dffb51346 100644 --- a/x/clp/keeper/rewards.go +++ b/x/clp/keeper/rewards.go @@ -77,7 +77,7 @@ func (k Keeper) DistributeDepthRewards(ctx sdk.Context, period *types.RewardPeri return nil } -func (k Keeper) UseUnlockedLiquidity(ctx sdk.Context, lp types.LiquidityProvider, units sdk.Uint) error { +func (k Keeper) UseUnlockedLiquidity(ctx sdk.Context, lp types.LiquidityProvider, units sdk.Uint, any bool) error { // Ensure there is enough liquidity requested for unlock, and also passed lock period. // Reduce liquidity in one or more unlock records. // Remove unlock records with zero units remaining. @@ -87,7 +87,7 @@ func (k Keeper) UseUnlockedLiquidity(ctx sdk.Context, lp types.LiquidityProvider unitsLeftToUse := units for _, record := range lp.Unlocks { - if record.RequestHeight+int64(lockPeriod) <= currentHeight { + if any || record.RequestHeight+int64(lockPeriod) <= currentHeight { if unitsLeftToUse.GT(record.Units) { // use all this record's unit's and continue with remaining unitsLeftToUse = unitsLeftToUse.Sub(record.Units) diff --git a/x/clp/keeper/rewards_test.go b/x/clp/keeper/rewards_test.go index c9c583b0c8..bcbe8dba68 100644 --- a/x/clp/keeper/rewards_test.go +++ b/x/clp/keeper/rewards_test.go @@ -82,6 +82,7 @@ func TestUseUnlockedLiquidity(t *testing.T) { name string height int64 use sdk.Uint + any bool unlocks []*types.LiquidityUnlock expected error }{ @@ -102,6 +103,19 @@ func TestUseUnlockedLiquidity(t *testing.T) { }, }, }, + { + name: "Unlock in any state", + height: 5, + use: sdk.NewUint(1000), + any: true, + expected: nil, + unlocks: []*types.LiquidityUnlock{ + { + RequestHeight: 1, + Units: sdk.NewUint(1000), + }, + }, + }, { name: "Available via split", height: 50, @@ -136,7 +150,7 @@ func TestUseUnlockedLiquidity(t *testing.T) { Unlocks: tc.unlocks, } app.ClpKeeper.SetLiquidityProvider(ctx, &lp) - err := app.ClpKeeper.UseUnlockedLiquidity(ctx, lp, sdk.NewUint(1000)) + err := app.ClpKeeper.UseUnlockedLiquidity(ctx, lp, sdk.NewUint(1000), tc.any) require.ErrorIs(t, err, tc.expected) }) } From ef4f574246007898675886706efbc599ff565771 Mon Sep 17 00:00:00 2001 From: Tim Lind Date: Tue, 3 May 2022 13:49:22 +0200 Subject: [PATCH 3/3] increment version --- app/setup_handlers.go | 2 +- version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/setup_handlers.go b/app/setup_handlers.go index 436d450933..83506b1e1e 100644 --- a/app/setup_handlers.go +++ b/app/setup_handlers.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -const releaseVersion = "0.13.1" +const releaseVersion = "0.13.2-rc.1" func SetupHandlers(app *SifchainApp) { app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm m.VersionMap) (m.VersionMap, error) { diff --git a/version b/version index c317a91891..0540a190cd 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.13.1 +0.13.2-rc.1