chore: regenerate umbrella crate, fix feature propagation

This commit is contained in:
2025-12-16 11:28:32 +03:00
parent dd6d48f528
commit 620b0e3aa0
1358 changed files with 9464 additions and 7656 deletions
@@ -21,6 +21,7 @@
//! are expected to be removed in the near future, once migration to `fungible::*` traits is done.
use super::*;
pub use imbalances::{NegativeImbalance, PositiveImbalance};
use pezframe_support::{
ensure,
pezpallet_prelude::DispatchResult,
@@ -33,7 +34,6 @@ use pezframe_support::{
},
};
use pezframe_system::pezpallet_prelude::BlockNumberFor;
pub use imbalances::{NegativeImbalance, PositiveImbalance};
use pezsp_runtime::traits::Bounded;
// wrapping these imbalances in a private module is necessary to ensure absolute privacy
@@ -126,8 +126,8 @@ impl<T: Config<I>, I: 'static> fungible::Inspect<T::AccountId> for Pezpallet<T,
// Provider restriction - total account balance cannot be reduced to zero if it cannot
// sustain the loss of a provider reference.
// NOTE: This assumes that the pezpallet is a provider (which is true). Is this ever changes,
// then this will need to adapt accordingly.
// NOTE: This assumes that the pezpallet is a provider (which is true). Is this ever
// changes, then this will need to adapt accordingly.
let ed = T::ExistentialDeposit::get();
let success = if new_free_balance < ed {
if pezframe_system::Pezpallet::<T>::can_dec_provider(who) {
+15 -12
View File
@@ -21,8 +21,8 @@
//! token.
//!
//! It makes heavy use of concepts such as Holds and Freezes from the
//! [`pezframe_support::traits::fungible`] traits, therefore you should read and understand those docs
//! as a prerequisite to understanding this pezpallet.
//! [`pezframe_support::traits::fungible`] traits, therefore you should read and understand those
//! docs as a prerequisite to understanding this pezpallet.
//!
//! Also see the [`frame_tokens`] reference docs for higher level information regarding the
//! place of this palet in FRAME.
@@ -81,8 +81,8 @@
//!
//! ### Examples from the FRAME
//!
//! The Contract pezpallet uses the `Currency` trait to handle gas payment, and its types inherit from
//! `Currency`:
//! The Contract pezpallet uses the `Currency` trait to handle gas payment, and its types inherit
//! from `Currency`:
//!
//! ```
//! use pezframe_support::traits::Currency;
@@ -159,6 +159,7 @@ use alloc::{
};
use codec::{Codec, MaxEncodedLen};
use core::{cmp, fmt::Debug, mem, result};
pub use impl_currency::{NegativeImbalance, PositiveImbalance};
use pezframe_support::{
ensure,
pezpallet_prelude::DispatchResult,
@@ -175,8 +176,6 @@ use pezframe_support::{
BoundedSlice, WeakBoundedVec,
};
use pezframe_system as system;
pub use impl_currency::{NegativeImbalance, PositiveImbalance};
use scale_info::TypeInfo;
use pezsp_core::{sr25519::Pair as SrPair, Pair};
use pezsp_runtime::{
traits::{
@@ -185,6 +184,7 @@ use pezsp_runtime::{
},
ArithmeticError, DispatchError, FixedPointOperand, Perbill, RuntimeDebug, TokenError,
};
use scale_info::TypeInfo;
pub use types::{
AccountData, AdjustmentDirection, BalanceLock, DustCleaner, ExtraFlags, Reasons, ReserveData,
@@ -288,9 +288,9 @@ pub mod pezpallet {
/// The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO!
///
/// If you *really* need it to be zero, you can enable the feature `insecure_zero_ed` for
/// this pezpallet. However, you do so at your own risk: this will open up a major DoS vector.
/// In case you have multiple sources of provider references, you may also get unexpected
/// behaviour if you set this to zero.
/// this pezpallet. However, you do so at your own risk: this will open up a major DoS
/// vector. In case you have multiple sources of provider references, you may also get
/// unexpected behaviour if you set this to zero.
///
/// Bottom line: Do yourself a favour and make it at least one!
#[pezpallet::constant]
@@ -497,8 +497,8 @@ pub mod pezpallet {
/// ```
///
/// But this comes with tradeoffs, storing account balances in the system pezpallet stores
/// `pezframe_system` data alongside the account data contrary to storing account balances in the
/// `Balances` pezpallet, which uses a `StorageMap` to store balances data only.
/// `pezframe_system` data alongside the account data contrary to storing account balances in
/// the `Balances` pezpallet, which uses a `StorageMap` to store balances data only.
/// NOTE: This is only used in the case that this pezpallet is used to store balances.
#[pezpallet::storage]
pub type Account<T: Config<I>, I: 'static = ()> =
@@ -1151,7 +1151,10 @@ pub mod pezpallet {
});
}
if let Some(amount) = maybe_dust {
Pezpallet::<T, I>::deposit_event(Event::DustLost { account: who.clone(), amount });
Pezpallet::<T, I>::deposit_event(Event::DustLost {
account: who.clone(),
amount,
});
}
(result, maybe_dust)
})
@@ -22,8 +22,8 @@ use crate::{
AdjustmentDirection::{Decrease as Dec, Increase as Inc},
Event,
};
use pezframe_support::traits::{fungible::Unbalanced, tokens::Preservation::Expendable};
use fungible::{hold::Mutate as HoldMutate, Inspect, Mutate};
use pezframe_support::traits::{fungible::Unbalanced, tokens::Preservation::Expendable};
/// Alice account ID for more readable tests.
const ALICE: u64 = 1;
@@ -16,8 +16,8 @@
// limitations under the License.
use super::*;
use pezframe_support::traits::fungible::{conformance_tests, Inspect, Mutate};
use paste::paste;
use pezframe_support::traits::fungible::{conformance_tests, Inspect, Mutate};
macro_rules! generate_tests {
// Handle a conformance test that requires special testing with and without a dust trap.
@@ -18,6 +18,10 @@
//! Tests regarding the functionality of the `fungible` trait set implementations.
use super::*;
use fungible::{
FreezeConsideration, HoldConsideration, Inspect, InspectFreeze, InspectHold,
LoneFreezeConsideration, LoneHoldConsideration, Mutate, MutateFreeze, MutateHold, Unbalanced,
};
use pezframe_support::traits::{
tokens::{
Fortitude::{Force, Polite},
@@ -27,10 +31,6 @@ use pezframe_support::traits::{
},
Consideration, Footprint, LinearStoragePrice, MaybeConsideration,
};
use fungible::{
FreezeConsideration, HoldConsideration, Inspect, InspectFreeze, InspectHold,
LoneFreezeConsideration, LoneHoldConsideration, Mutate, MutateFreeze, MutateHold, Unbalanced,
};
use pezsp_core::ConstU64;
#[test]
@@ -36,7 +36,6 @@ use pezframe_support::{
};
use pezframe_system::{self as system, RawOrigin};
use pezpallet_transaction_payment::{ChargeTransactionPayment, FungibleAdapter, Multiplier};
use scale_info::TypeInfo;
use pezsp_core::{hexdisplay::HexDisplay, sr25519::Pair as SrPair, Pair};
use pezsp_io;
use pezsp_runtime::{
@@ -44,6 +43,7 @@ use pezsp_runtime::{
ArithmeticError, BuildStorage, DispatchError, DispatchResult, FixedPointNumber, RuntimeDebug,
TokenError,
};
use scale_info::TypeInfo;
use std::collections::BTreeSet;
mod consumer_limit_tests;
@@ -371,8 +371,8 @@ fn check_whitelist() {
assert!(whitelist.contains("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80"));
}
/// This pezpallet runs tests twice, once with system as `type AccountStore` and once this pezpallet. This
/// function will return the right value based on the `UseSystem` flag.
/// This pezpallet runs tests twice, once with system as `type AccountStore` and once this
/// pezpallet. This function will return the right value based on the `UseSystem` flag.
pub(crate) fn get_test_account_data(who: AccountId) -> AccountData<Balance> {
if UseSystem::get() {
<SystemAccountStore as StoredMap<_, _>>::get(&who)
@@ -381,8 +381,8 @@ pub(crate) fn get_test_account_data(who: AccountId) -> AccountData<Balance> {
}
}
/// Same as `get_test_account_data`, but returns a `pezframe_system::AccountInfo` with the data filled
/// in.
/// Same as `get_test_account_data`, but returns a `pezframe_system::AccountInfo` with the data
/// filled in.
pub(crate) fn get_test_account(
who: AccountId,
) -> pezframe_system::AccountInfo<u32, AccountData<Balance>> {
@@ -18,12 +18,12 @@
//! Tests regarding the reentrancy functionality.
use super::*;
use fungible::Balanced;
use pezframe_support::traits::tokens::{
Fortitude::Force,
Precision::BestEffort,
Preservation::{Expendable, Protect},
};
use fungible::Balanced;
#[test]
fn transfer_dust_removal_tst1_should_work() {
+1 -1
View File
@@ -21,8 +21,8 @@ use crate::{Config, CreditOf, Event, Pezpallet};
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use core::ops::BitOr;
use pezframe_support::traits::{Imbalance, LockIdentifier, OnUnbalanced, WithdrawReasons};
use scale_info::TypeInfo;
use pezsp_runtime::{RuntimeDebug, Saturating};
use scale_info::TypeInfo;
/// Simplified reasons for withdrawing balance.
#[derive(