Various minor fixes (#13945)

* Fix: Incorrect implementation of can_reserve check

* Fix: Incorrect migration of consumer counting for existing accounts with frozen amounts

* Fix: Inconsistent implementation between assets can_deposit and new_account

* Fixes

* Fixes

* Another fix

* Update tests.rs

* Update fungible_tests.rs

* Use `can_accrue_consumers` in the body of `can_inc_consumer`

---------

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
This commit is contained in:
Gavin Wood
2023-04-26 15:26:07 +01:00
committed by GitHub
parent 356b752d58
commit 781ea7cbdc
7 changed files with 98 additions and 16 deletions
@@ -1180,6 +1180,16 @@ fn named_reserve_should_work() {
});
}
#[test]
fn reserve_must_succeed_if_can_reserve_does() {
ExtBuilder::default().build_and_execute_with(|| {
let _ = Balances::deposit_creating(&1, 1);
let _ = Balances::deposit_creating(&2, 2);
assert!(Balances::can_reserve(&1, 1) == Balances::reserve(&1, 1).is_ok());
assert!(Balances::can_reserve(&2, 1) == Balances::reserve(&2, 1).is_ok());
});
}
#[test]
fn reserved_named_to_yourself_should_work() {
ExtBuilder::default().build_and_execute_with(|| {