Fix amount emitted in rebonded event (#9866)

This commit is contained in:
Shawn Tabrizi
2021-09-26 02:26:57 -04:00
committed by GitHub
parent cf19f1f442
commit d342d282a6
3 changed files with 65 additions and 4 deletions
+4 -2
View File
@@ -478,7 +478,9 @@ impl<AccountId, Balance: HasCompact + Copy + Saturating + AtLeast32BitUnsigned>
}
/// Re-bond funds that were scheduled for unlocking.
fn rebond(mut self, value: Balance) -> Self {
///
/// Returns the updated ledger, and the amount actually rebonded.
fn rebond(mut self, value: Balance) -> (Self, Balance) {
let mut unlocking_balance: Balance = Zero::zero();
while let Some(last) = self.unlocking.last_mut() {
@@ -499,7 +501,7 @@ impl<AccountId, Balance: HasCompact + Copy + Saturating + AtLeast32BitUnsigned>
}
}
self
(self, unlocking_balance)
}
}