diff --git a/tokens/Cargo.toml b/tokens/Cargo.toml index 7644e3635..ff8dec2dd 100644 --- a/tokens/Cargo.toml +++ b/tokens/Cargo.toml @@ -3,7 +3,7 @@ name = "orml-tokens" description = "Fungible tokens module that implements `MultiCurrency` trait." repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/tokens" license = "Apache-2.0" -version = "0.8.0" +version = "0.8.1" authors = ["Laminar Developers "] edition = "2021" diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index b5375561d..a00435e3a 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -1808,7 +1808,9 @@ impl fungibles::Inspect for Pallet { let a = Self::accounts(who, asset_id); // Liquid balance is what is neither reserved nor locked/frozen. let liquid = a.free.saturating_sub(a.frozen); - if frame_system::Pallet::::can_dec_provider(who) && !matches!(preservation, Preservation::Protect) { + if frame_system::Pallet::::can_dec_provider(who) + && !matches!(preservation, Preservation::Protect | Preservation::Preserve) + { liquid } else { // `must_remain_to_exist` is the part of liquid balance which must remain to diff --git a/tokens/src/tests_fungibles.rs b/tokens/src/tests_fungibles.rs index d7b6abf55..2d975c727 100644 --- a/tokens/src/tests_fungibles.rs +++ b/tokens/src/tests_fungibles.rs @@ -27,6 +27,15 @@ fn fungibles_inspect_trait_should_work() { ), 98 ); + assert_eq!( + >::reducible_balance( + DOT, + &ALICE, + Preservation::Preserve, + Fortitude::Polite + ), + 98 + ); assert_ok!( >::can_deposit(DOT, &ALICE, 1, Provenance::Extant).into_result() );