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:
Wei Tang
2020-08-12 12:46:28 +02:00
committed by GitHub
parent 36a8c720f2
commit 64901c015e
2 changed files with 24 additions and 4 deletions
+4 -4
View File
@@ -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());
}
}