Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Add simple decrease_balance test
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Oct 29, 2022
1 parent e751aff commit 7691522
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions frame/balances/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,20 @@ macro_rules! decl_tests {
});
}

#[test]
fn fungible_unbalanced_trait_decrease_balance_simple_works() {
<$ext_builder>::default().build().execute_with(|| {
// An Account that starts at 100
assert_ok!(<Balances as fungible::Unbalanced<_>>::set_balance(&1337, 100));
// and reserves 50
assert_ok!(Balances::reserve(&1337, 50));
// and is decreased by 20
assert_ok!(<Balances as fungible::Unbalanced<_>>::decrease_balance(&1337, 20));
// should end up at 80.
assert_eq!(<Balances as fungible::Inspect<_>>::balance(&1337), 80);
});
}

#[test]
fn fungible_unbalanced_trait_decrease_balance_works() {
<$ext_builder>::default().build().execute_with(|| {
Expand Down

0 comments on commit 7691522

Please sign in to comment.