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:
Squirrel
2024-02-06 13:01:29 +00:00
committed by GitHub
parent c552fb5495
commit bc2e5e1fe2
75 changed files with 125 additions and 125 deletions
@@ -84,7 +84,7 @@ use frame_election_provider_support::{
pub struct StaticTracker<DataProvider> {
pub size: usize,
pub counter: usize,
_marker: sp_std::marker::PhantomData<DataProvider>,
_marker: core::marker::PhantomData<DataProvider>,
}
impl<DataProvider> Default for StaticTracker<DataProvider> {
+5 -5
View File
@@ -64,7 +64,7 @@ type StorageVersion<T: Config> = StorageValue<Pallet<T>, ObsoleteReleases, Value
pub mod v14 {
use super::*;
pub struct MigrateToV14<T>(sp_std::marker::PhantomData<T>);
pub struct MigrateToV14<T>(core::marker::PhantomData<T>);
impl<T: Config> OnRuntimeUpgrade for MigrateToV14<T> {
fn on_runtime_upgrade() -> Weight {
let current = Pallet::<T>::current_storage_version();
@@ -95,7 +95,7 @@ pub mod v14 {
pub mod v13 {
use super::*;
pub struct MigrateToV13<T>(sp_std::marker::PhantomData<T>);
pub struct MigrateToV13<T>(core::marker::PhantomData<T>);
impl<T: Config> OnRuntimeUpgrade for MigrateToV13<T> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError> {
@@ -151,7 +151,7 @@ pub mod v12 {
///
/// We will be depending on the configurable value of `T::HistoryDepth` post
/// this release.
pub struct MigrateToV12<T>(sp_std::marker::PhantomData<T>);
pub struct MigrateToV12<T>(core::marker::PhantomData<T>);
impl<T: Config> OnRuntimeUpgrade for MigrateToV12<T> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError> {
@@ -205,7 +205,7 @@ pub mod v11 {
#[cfg(feature = "try-runtime")]
use sp_io::hashing::twox_128;
pub struct MigrateToV11<T, P, N>(sp_std::marker::PhantomData<(T, P, N)>);
pub struct MigrateToV11<T, P, N>(core::marker::PhantomData<(T, P, N)>);
impl<T: Config, P: GetStorageVersion + PalletInfoAccess, N: Get<&'static str>> OnRuntimeUpgrade
for MigrateToV11<T, P, N>
{
@@ -301,7 +301,7 @@ pub mod v10 {
/// That means we might slash someone a bit too early, but we will definitely
/// won't forget to slash them. The cap of 512 is somewhat randomly taken to
/// prevent us from iterating over an arbitrary large number of keys `on_runtime_upgrade`.
pub struct MigrateToV10<T>(sp_std::marker::PhantomData<T>);
pub struct MigrateToV10<T>(core::marker::PhantomData<T>);
impl<T: Config> OnRuntimeUpgrade for MigrateToV10<T> {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
if StorageVersion::<T>::get() == ObsoleteReleases::V9_0_0 {