diff --git a/crates/core/component/stake/src/penalty.rs b/crates/core/component/stake/src/penalty.rs index 8a66951e50..6896b71ed2 100644 --- a/crates/core/component/stake/src/penalty.rs +++ b/crates/core/component/stake/src/penalty.rs @@ -58,7 +58,7 @@ impl Penalty { /// Compound this `Penalty` with another `Penalty`. pub fn compound(&self, other: Penalty) -> Penalty { - Self((self.0 * other.0).expect("compounding penalities will not overflow")) + Self((self.0 * other.0).expect("compounding penalties will not overflow")) } /// Apply this `Penalty` to an `Amount` of unbonding tokens. diff --git a/crates/core/component/stake/src/undelegate.rs b/crates/core/component/stake/src/undelegate.rs index 34e0102fbc..f7ccb2bb8e 100644 --- a/crates/core/component/stake/src/undelegate.rs +++ b/crates/core/component/stake/src/undelegate.rs @@ -36,7 +36,10 @@ impl EffectingData for Undelegate { impl Undelegate { /// Return the balance after consuming delegation tokens, and producing unbonding tokens. pub fn balance(&self) -> Balance { - let stake = Balance::from(Value { + // We produce undelegation tokens at a rate of 1:1 with their + // unbonded value. When these tokens are claimed, we carry over + // penalties accumulated during the unbonding window. + let undelegation = Balance::from(Value { amount: self.unbonded_amount, asset_id: self.unbonding_token().id(), }); @@ -46,8 +49,8 @@ impl Undelegate { asset_id: self.delegation_token().id(), }); - // We consume the delegation tokens and produce the staking tokens. - stake - delegation + // We consume the delegation tokens and produce the undelegation tokens. + undelegation - delegation } pub fn unbonding_token(&self) -> UnbondingToken {