mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-22 16:11:08 +00:00
pallet-evm: fix wrong logic in mutate_account_basic (#6786)
* pallet-evm: fix wrong logic in mutate_account_basic * Add test for mutate account
This commit is contained in:
@@ -438,11 +438,11 @@ impl<T: Trait> Module<T> {
|
||||
}
|
||||
}
|
||||
|
||||
if current.balance < new.balance {
|
||||
let diff = new.balance - current.balance;
|
||||
T::Currency::slash(&account_id, diff.low_u128().unique_saturated_into());
|
||||
} else if current.balance > new.balance {
|
||||
if current.balance > new.balance {
|
||||
let diff = current.balance - new.balance;
|
||||
T::Currency::slash(&account_id, diff.low_u128().unique_saturated_into());
|
||||
} else if current.balance < new.balance {
|
||||
let diff = new.balance - current.balance;
|
||||
T::Currency::deposit_creating(&account_id, diff.low_u128().unique_saturated_into());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user