Skip to content

Commit

Permalink
fix: Fix release unbondings to update unbonding list
Browse files Browse the repository at this point in the history
  • Loading branch information
OnedgeLee committed Dec 13, 2024
1 parent 86b8103 commit e0f4cb0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override IWorld Execute(IActionContext context)
var unbondingSet = repository.GetUnbondingSet();
var unbondings = unbondingSet.UnbondingsToRelease(context.BlockIndex);

foreach (var unbonding in unbondings)
unbondings = unbondings.Select<IUnbonding, IUnbonding>(unbonding =>
{
switch (unbonding)
{
Expand All @@ -55,15 +55,15 @@ public override IWorld Execute(IActionContext context)
repository.SetUnbondLockIn(unbondLockIn);
repository.UpdateWorld(
Unstake(repository.World, context, unbondLockIn, releasedFAV));
break;
return unbondLockIn;
case RebondGrace rebondGrace:
rebondGrace = rebondGrace.Release(context.BlockIndex, out _);
repository.SetRebondGrace(rebondGrace);
break;
return rebondGrace;
default:
throw new InvalidOperationException("Invalid unbonding type.");
}
}
}).ToImmutableArray();

repository.SetUnbondingSet(unbondingSet.SetUnbondings(unbondings));

Expand Down

0 comments on commit e0f4cb0

Please sign in to comment.