Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita99b906

Browse files
committed
feat(validations): invert "unstake-it-all" logic
namely, use 0 instead of u64::MAX as the "unstake-it-all" meta-value
1 parentc3e9e93 commita99b906

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎validations/src/validations.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,9 @@ pub fn validate_unstake_transaction<'a>(
15201520
// Introduced in V2_1:
15211521
// Apply a protocol-level "rule of convenience", where an amount to unstake of u64::MAX actually
15221522
// means "unstake all my stake".
1523-
if protocol_version >=ProtocolVersion::V2_1 && amount_to_unstake == u64::MAX{
1523+
// Please take note that this validation sctrictly needs to take place before checking whether
1524+
// the "remainder" amount meets the minimum stake. Otherwise, we would never reach this block.
1525+
if protocol_version >=ProtocolVersion::V2_1 && amount_to_unstake ==0{
15241526
amount_to_unstake = staked_amount;
15251527
}
15261528

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp