-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dynamically update user redemption records during unbonding (#1053)
Co-authored-by: riley-stride <104941670+riley-stride@users.noreply.github.com> Co-authored-by: vish-stride <vishal@stridelabs.co> Co-authored-by: shellvish <104537253+shellvish@users.noreply.github.com> Co-authored-by: ethan-stride <126913021+ethan-stride@users.noreply.github.com> Co-authored-by: Aidan Salzmann <aidan@stridelabs.co>
- Loading branch information
1 parent
e96f3f8
commit 7f88955
Showing
15 changed files
with
709 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package types | ||
|
||
import sdkmath "cosmossdk.io/math" | ||
|
||
// Helper function to evaluate if a host zone unbonding record still needs to be initiated | ||
func (r HostZoneUnbonding) ShouldInitiateUnbonding() bool { | ||
notYetUnbonding := r.Status == HostZoneUnbonding_UNBONDING_QUEUE | ||
hasAtLeastOneRecord := r.NativeTokenAmount.GT(sdkmath.ZeroInt()) | ||
return notYetUnbonding && hasAtLeastOneRecord | ||
} |
Oops, something went wrong.