//! The System pallet provides low-level access to core types and cross-cutting utilities. It acts
//! In addition, it manages the storage items for extrinsic data, indices, event records, and digest
//! It also handles low-level tasks like depositing logs, basic set up and take down of temporary
//! The System pallet provides dispatchable functions that, with the exception of `remark`, manage
//! authorized, anyone may upload the correct runtime to apply the code. This pattern is useful when
//! The `*_without_checks` variants do not perform any version checks, so using them runs the risk
//! of applying a downgrade or entirely other chain specification. They will still validate that the
//! - [`CheckGenesis`]: Checks the provided genesis hash of the transaction. Must be a part of the
//! - [`CheckTxVersion`]: Checks that the transaction version is the same as the one used to sign
#[pallet::weight((T::SystemWeightInfo::apply_authorized_upgrade(), DispatchClass::Operational))]
#[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode, TypeInfo, MaxEncodedLen)]
/// The number of other modules that allow this account to exist. The account may not be reaped
impl< { O: .., Who: SortedMembers<AccountId>, AccountId: PartialEq + Clone + Ord + Decode, T } >
pub fn ensure_signed<OuterOrigin, AccountId>(o: OuterOrigin) -> Result<AccountId, BadOrigin>
/// Ensure that the origin `o` represents either a signed extrinsic (i.e. transaction) or the root.
/// Returns `Ok` with the account that signed the extrinsic, `None` if it was root, or an `Err`
/// Ensure that the origin `o` represents an unsigned extrinsic. Returns `Ok` or an `Err` otherwise.
/// Should be called immediately after all inherents have been applied. Must be called at least
/// Decrement the reference counter on an account. This *MUST* only be done once for every time
/// Decrement the reference counter on an account. This *MUST* only be done once for every time
/// stick to static weights. A typical use case for this is inner calls or smart contract calls.
/// unknown, user provided call's weight, it would only make sense to use it if you are sure you
pub fn initialize(number: &BlockNumberFor<T>, parent_hash: &T::Hash, digest: &generic::Digest) {
T::BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap_or(Bounded::max_value()).ref_time()
T::BlockWeights::get().get(DispatchClass::Operational).max_total.unwrap_or(Bounded::max_value()).ref_time()
T::BlockWeights::get().get(DispatchClass::Mandatory).max_total.unwrap_or(Bounded::max_value()).ref_time()
pub fn on_created_account(who: T::AccountId, _a: &mut AccountInfo<T::Nonce, T::AccountData>) {
/// Apply an authorized upgrade, performing any validation checks, and remove the authorization.
/// Returns a 32 byte datum which is guaranteed to be universally unique. `entropy` is provided
/// Implement StoredMap for a simple single-item, provide-when-not-default system. This works fine
/// for storing a single item which allows the account to continue existing as long as it's not