From d79c091d7b6d99b5755ed97418909e3296103b9f Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 07 Sep 2022 09:47:13 +0000 Subject: [PATCH] fix stake logic --- --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -280,7 +280,9 @@ &staker_id, amount, WithdrawReasons::all(), - balance - amount, + balance + .checked_sub(&amount) + .ok_or(ArithmeticError::Underflow)?, )?; Self::add_lock_balance(&staker_id, amount)?; -- gitstuff