mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 09:57:56 +00:00
sp-std -> core (#3199)
First in a series of PRs that reduces our use of sp-std with a view to deprecating it. This is just looking at /substrate and moving some of the references from `sp-std` to `core`. These particular changes should be uncontroversial. Where macros are used `::core` should be used to remove any ambiguity. part of https://github.com/paritytech/polkadot-sdk/issues/2101
This commit is contained in:
@@ -171,7 +171,7 @@ pub mod frame_system {
|
||||
pub data: Vec<(u32, u64)>,
|
||||
pub test_config: Vec<(u32, u32, u64)>,
|
||||
#[serde(skip)]
|
||||
pub _config: sp_std::marker::PhantomData<T>,
|
||||
pub _config: core::marker::PhantomData<T>,
|
||||
}
|
||||
|
||||
impl<T: Config> Default for GenesisConfig<T> {
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
|
||||
use crate::dispatch::{DispatchResultWithPostInfo, Parameter, RawOrigin};
|
||||
use codec::MaxEncodedLen;
|
||||
use core::{cmp::Ordering, marker::PhantomData};
|
||||
use sp_runtime::{
|
||||
traits::{BadOrigin, Get, Member, Morph, TryMorph},
|
||||
Either,
|
||||
};
|
||||
use sp_std::{cmp::Ordering, marker::PhantomData};
|
||||
|
||||
use super::misc;
|
||||
|
||||
@@ -85,7 +85,7 @@ pub trait EnsureOrigin<OuterOrigin> {
|
||||
/// ```rust
|
||||
/// # use frame_support::traits::{EnsureOriginEqualOrHigherPrivilege, PrivilegeCmp, EnsureOrigin as _};
|
||||
/// # use sp_runtime::traits::{parameter_types, Get};
|
||||
/// # use sp_std::cmp::Ordering;
|
||||
/// # use core::cmp::Ordering;
|
||||
///
|
||||
/// #[derive(Eq, PartialEq, Debug)]
|
||||
/// pub enum Origin {
|
||||
@@ -124,7 +124,7 @@ pub trait EnsureOrigin<OuterOrigin> {
|
||||
/// assert!(EnsureOrigin::ensure_origin(Origin::NormalUser).is_err());
|
||||
/// ```
|
||||
pub struct EnsureOriginEqualOrHigherPrivilege<Origin, PrivilegeCmp>(
|
||||
sp_std::marker::PhantomData<(Origin, PrivilegeCmp)>,
|
||||
core::marker::PhantomData<(Origin, PrivilegeCmp)>,
|
||||
);
|
||||
|
||||
impl<OuterOrigin, Origin, PrivilegeCmp> EnsureOrigin<OuterOrigin>
|
||||
@@ -218,7 +218,7 @@ macro_rules! impl_ensure_origin_with_arg_ignoring_arg {
|
||||
}
|
||||
|
||||
/// [`EnsureOrigin`] implementation that always fails.
|
||||
pub struct NeverEnsureOrigin<Success>(sp_std::marker::PhantomData<Success>);
|
||||
pub struct NeverEnsureOrigin<Success>(core::marker::PhantomData<Success>);
|
||||
impl<OO, Success> EnsureOrigin<OO> for NeverEnsureOrigin<Success> {
|
||||
type Success = Success;
|
||||
fn try_origin(o: OO) -> Result<Success, OO> {
|
||||
@@ -235,7 +235,7 @@ impl_ensure_origin_with_arg_ignoring_arg! {
|
||||
{}
|
||||
}
|
||||
|
||||
pub struct AsEnsureOriginWithArg<EO>(sp_std::marker::PhantomData<EO>);
|
||||
pub struct AsEnsureOriginWithArg<EO>(core::marker::PhantomData<EO>);
|
||||
impl<OuterOrigin, Argument, EO: EnsureOrigin<OuterOrigin>>
|
||||
EnsureOriginWithArg<OuterOrigin, Argument> for AsEnsureOriginWithArg<EO>
|
||||
{
|
||||
@@ -353,7 +353,7 @@ impl<
|
||||
/// Origin check will pass if `L` or `R` origin check passes. `L` is tested first.
|
||||
///
|
||||
/// Successful origin is derived from the left side.
|
||||
pub struct EitherOfDiverse<L, R>(sp_std::marker::PhantomData<(L, R)>);
|
||||
pub struct EitherOfDiverse<L, R>(core::marker::PhantomData<(L, R)>);
|
||||
impl<OuterOrigin, L: EnsureOrigin<OuterOrigin>, R: EnsureOrigin<OuterOrigin>>
|
||||
EnsureOrigin<OuterOrigin> for EitherOfDiverse<L, R>
|
||||
{
|
||||
@@ -402,7 +402,7 @@ pub type EnsureOneOf<L, R> = EitherOfDiverse<L, R>;
|
||||
/// Origin check will pass if `L` or `R` origin check passes. `L` is tested first.
|
||||
///
|
||||
/// Successful origin is derived from the left side.
|
||||
pub struct EitherOf<L, R>(sp_std::marker::PhantomData<(L, R)>);
|
||||
pub struct EitherOf<L, R>(core::marker::PhantomData<(L, R)>);
|
||||
impl<
|
||||
OuterOrigin,
|
||||
L: EnsureOrigin<OuterOrigin>,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
//! Traits for describing and constraining pallet error types.
|
||||
use codec::{Compact, Decode, Encode};
|
||||
use sp_std::marker::PhantomData;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Trait indicating that the implementing type is going to be included as a field in a variant of
|
||||
/// the `#[pallet::error]` enum type.
|
||||
|
||||
@@ -81,7 +81,7 @@ pub trait StoredMap<K, T: Default> {
|
||||
/// be the default value), or where the account is being removed or reset back to the default value
|
||||
/// where previously it did exist (though may have been in a default state). This works well with
|
||||
/// system module's `CallOnCreatedAccount` and `CallKillAccount`.
|
||||
pub struct StorageMapShim<S, K, T>(sp_std::marker::PhantomData<(S, K, T)>);
|
||||
pub struct StorageMapShim<S, K, T>(core::marker::PhantomData<(S, K, T)>);
|
||||
impl<S: StorageMap<K, T, Query = T>, K: FullCodec, T: FullCodec + Default> StoredMap<K, T>
|
||||
for StorageMapShim<S, K, T>
|
||||
{
|
||||
|
||||
@@ -211,7 +211,7 @@ pub trait Currency<AccountId> {
|
||||
|
||||
/// A non-const `Get` implementation parameterised by a `Currency` impl which provides the result
|
||||
/// of `total_issuance`.
|
||||
pub struct TotalIssuanceOf<C: Currency<A>, A>(sp_std::marker::PhantomData<(C, A)>);
|
||||
pub struct TotalIssuanceOf<C: Currency<A>, A>(core::marker::PhantomData<(C, A)>);
|
||||
impl<C: Currency<A>, A> Get<C::Balance> for TotalIssuanceOf<C, A> {
|
||||
fn get() -> C::Balance {
|
||||
C::total_issuance()
|
||||
@@ -220,7 +220,7 @@ impl<C: Currency<A>, A> Get<C::Balance> for TotalIssuanceOf<C, A> {
|
||||
|
||||
/// A non-const `Get` implementation parameterised by a `Currency` impl which provides the result
|
||||
/// of `active_issuance`.
|
||||
pub struct ActiveIssuanceOf<C: Currency<A>, A>(sp_std::marker::PhantomData<(C, A)>);
|
||||
pub struct ActiveIssuanceOf<C: Currency<A>, A>(core::marker::PhantomData<(C, A)>);
|
||||
impl<C: Currency<A>, A> Get<C::Balance> for ActiveIssuanceOf<C, A> {
|
||||
fn get() -> C::Balance {
|
||||
C::active_issuance()
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
//! with unbalanced operations.
|
||||
|
||||
use crate::traits::misc::{SameOrOther, TryDrop};
|
||||
use core::ops::Div;
|
||||
use sp_runtime::traits::Saturating;
|
||||
use sp_std::ops::Div;
|
||||
|
||||
mod on_unbalanced;
|
||||
mod signed_imbalance;
|
||||
|
||||
Reference in New Issue
Block a user