Rebuild, add a couple of tests and fix theoretical issue (#2056)

* Rebuild, add a couple of tests and fix theoretical issue

* Update lib.rs
This commit is contained in:
Gav Wood
2019-03-21 13:56:31 +01:00
committed by GitHub
parent b31bcdfcc3
commit df65a92c91
4 changed files with 46 additions and 2 deletions
+30
View File
@@ -440,6 +440,36 @@ fn transferring_too_high_value_should_not_panic() {
});
}
#[test]
fn account_create_on_free_too_low_with_other() {
with_externalities(
&mut ExtBuilder::default().existential_deposit(100).build(),
|| {
let _ = Balances::deposit_creating(&1, 100);
assert_eq!(<TotalIssuance<Runtime>>::get(), 100);
// No-op.
let _ = Balances::deposit_creating(&2, 50);
assert_eq!(Balances::free_balance(&2), 0);
assert_eq!(<TotalIssuance<Runtime>>::get(), 100);
}
)
}
#[test]
fn account_create_on_free_too_low() {
with_externalities(
&mut ExtBuilder::default().existential_deposit(100).build(),
|| {
// No-op.
let _ = Balances::deposit_creating(&2, 50);
assert_eq!(Balances::free_balance(&2), 0);
assert_eq!(<TotalIssuance<Runtime>>::get(), 0);
}
)
}
#[test]
fn account_removal_on_free_too_low() {
with_externalities(