Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lockup duration edit method #1253

Merged
merged 23 commits into from
May 4, 2022
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
  • Loading branch information
mconcat and alexanderbez authored Apr 18, 2022
commit ba815a5a9b1776c0bc5ad1c38952ed3bc10126b2
3 changes: 0 additions & 3 deletions x/lockup/keeper/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,7 @@ func (k Keeper) unlockInternalLogic(ctx sdk.Context, lock types.PeriodLock) erro
}

func (k Keeper) EditLockup(ctx sdk.Context, lock types.PeriodLock, newDuration time.Duration) error {
// sanity check

// check unlocking
if lock.IsUnlocking() {
return fmt.Errorf("cannot edit unlocking lockup")
mconcat marked this conversation as resolved.
Show resolved Hide resolved
}
Expand All @@ -552,7 +550,6 @@ func (k Keeper) EditLockup(ctx sdk.Context, lock types.PeriodLock, newDuration t
}

if newDuration != 0 {
// check newDuration > duration
if !(newDuration > lock.Duration) {
mconcat marked this conversation as resolved.
Show resolved Hide resolved
return fmt.Errorf("new duration should be greater than the original")
}
Expand Down