Skip to content

Commit

Permalink
rebased
Browse files Browse the repository at this point in the history
  • Loading branch information
stackman27 committed Aug 12, 2022
1 parent 3921b30 commit 2c55587
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 2 additions & 7 deletions x/lockup/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ func (server msgServer) LockTokens(goCtx context.Context, msg *types.MsgLockToke
return nil, err
}

// return the lock id of the existing lock when successfully added to the existing lock.
if len(locks) > 0 {
events.EmitAddTokenToLock(ctx, locks[0].ID, msg.GetOwner(), msg.GetCoins().String())
return &types.MsgLockTokensResponse{ID: locks[0].ID}, nil
events.EmitAddTokenToLock(ctx, lockID, msg.Owner, msg.Coins.String())
return &types.MsgLockTokensResponse{ID: lockID}, nil
}

// if the owner + duration combination is new, create a new lock.
Expand All @@ -59,7 +57,6 @@ func (server msgServer) LockTokens(goCtx context.Context, msg *types.MsgLockToke
}

events.EmitLockToken(ctx, &lock)

return &types.MsgLockTokensResponse{ID: lock.ID}, nil
}

Expand Down Expand Up @@ -88,7 +85,6 @@ func (server msgServer) BeginUnlocking(goCtx context.Context, msg *types.MsgBegi
}

events.EmitBeginUnlock(ctx, lock)

return &types.MsgBeginUnlockingResponse{}, nil
}

Expand All @@ -115,7 +111,6 @@ func (server msgServer) BeginUnlockingAll(goCtx context.Context, msg *types.MsgB
sdk.NewAttribute(types.AttributeUnlockedCoins, unlockedCoins.String()),
),
}

for _, lock := range unlocks {
lock := lock
allEvents = allEvents.AppendEvent(events.BeginUnlockEvent(&lock))
Expand Down
2 changes: 0 additions & 2 deletions x/lockup/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,3 @@ func (suite *KeeperTestSuite) TestMsgEditLockup() {
}
}
}

// TODO: ADD add to existing lock test

0 comments on commit 2c55587

Please sign in to comment.