From e02a3232c2721d55123be2d5fa679c17e5d0f3f4 Mon Sep 17 00:00:00 2001 From: Giancarlos Salas Date: Thu, 31 Mar 2022 16:48:10 -0500 Subject: [PATCH 1/3] Get endtime from updated lock --- x/lockup/keeper/msg_server.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/x/lockup/keeper/msg_server.go b/x/lockup/keeper/msg_server.go index bef5b45565b..013aaf57538 100644 --- a/x/lockup/keeper/msg_server.go +++ b/x/lockup/keeper/msg_server.go @@ -94,13 +94,18 @@ func (server msgServer) BeginUnlocking(goCtx context.Context, msg *types.MsgBegi return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } + if msg.Owner != lock.Owner { + return nil, sdkerrors.Wrap(types.ErrNotLockOwner, fmt.Sprintf("msg sender(%s) and lock owner(%s) does not match", msg.Owner, lock.Owner)) + } + err = server.keeper.BeginUnlock(ctx, lock.ID, msg.Coins) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } - if msg.Owner != lock.Owner { - return nil, sdkerrors.Wrap(types.ErrNotLockOwner, fmt.Sprintf("msg sender(%s) and lock owner(%s) does not match", msg.Owner, lock.Owner)) + lock, err = server.keeper.GetLockByID(ctx, msg.ID) + if err != nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } ctx.EventManager().EmitEvents(sdk.Events{ From 4ac1d279b3cb3ce8153f2f45a6a56faa2bce7dc3 Mon Sep 17 00:00:00 2001 From: Giancarlos Salas Date: Fri, 1 Apr 2022 11:00:53 -0500 Subject: [PATCH 2/3] Format lock owner error message --- x/lockup/keeper/msg_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/lockup/keeper/msg_server.go b/x/lockup/keeper/msg_server.go index 013aaf57538..22f2d12367b 100644 --- a/x/lockup/keeper/msg_server.go +++ b/x/lockup/keeper/msg_server.go @@ -95,7 +95,7 @@ func (server msgServer) BeginUnlocking(goCtx context.Context, msg *types.MsgBegi } if msg.Owner != lock.Owner { - return nil, sdkerrors.Wrap(types.ErrNotLockOwner, fmt.Sprintf("msg sender(%s) and lock owner(%s) does not match", msg.Owner, lock.Owner)) + return nil, sdkerrors.Wrap(types.ErrNotLockOwner, fmt.Sprintf("msg sender (%s) and lock owner (%s) does not match", msg.Owner, lock.Owner)) } err = server.keeper.BeginUnlock(ctx, lock.ID, msg.Coins) From 550a1ca442cd282de1862e275875aa9430217079 Mon Sep 17 00:00:00 2001 From: Giancarlos Salas Date: Fri, 1 Apr 2022 11:05:54 -0500 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98321c37384..0ecc7b0215d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1022](https://github.com/osmosis-labs/osmosis/pull/1022) upgrade iavl to v0.17.3-osmo-v4 - fix state export at an old height * [#988](https://github.com/osmosis-labs/osmosis/pull/988) Make `SuperfluidUndelegationsByDelegator` query also return synthetic locks * [#984](https://github.com/osmosis-labs/osmosis/pull/984) Add wasm support to Dockerfile +* [#1184](https://github.com/osmosis-labs/osmosis/pull/1184) Fix endtime event output on BeginUnlocking ## [v7.0.2 - Carbon](https://github.com/osmosis-labs/osmosis/releases/tag/v7.0.2)