Skip to content

Commit 7ecf3f7

Browse files
jaslbkchr
andauthored
Remove most all usage of sp-std (#5010)
This should remove nearly all usage of `sp-std` except: - bridge and bridge-hubs - a few of frames re-export `sp-std`, keep them for now - there is a usage of `sp_std::Writer`, I don't have an idea how to move it Please review proc-macro carefully. I'm not sure I'm doing it the right way. Note: need `/bot fmt` --------- Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: command-bot <>
1 parent 291210a commit 7ecf3f7

825 files changed

Lines changed: 1835 additions & 1938 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 0 additions & 159 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cumulus/client/parachain-inherent/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ sp-crypto-hashing = { workspace = true, default-features = true }
1818
sp-inherents = { workspace = true, default-features = true }
1919
sp-runtime = { workspace = true, default-features = true }
2020
sp-state-machine = { workspace = true, default-features = true }
21-
sp-std = { workspace = true, default-features = true }
2221
sp-storage = { workspace = true, default-features = true }
2322
sp-trie = { workspace = true, default-features = true }
2423

cumulus/client/relay-chain-inprocess-interface/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
1616

17-
use std::{pin::Pin, sync::Arc, time::Duration};
17+
use std::{collections::btree_map::BTreeMap, pin::Pin, sync::Arc, time::Duration};
1818

1919
use async_trait::async_trait;
2020
use cumulus_primitives_core::{
@@ -38,7 +38,7 @@ use sc_client_api::{
3838
use sc_telemetry::TelemetryWorkerHandle;
3939
use sp_api::ProvideRuntimeApi;
4040
use sp_consensus::SyncOracle;
41-
use sp_core::{sp_std::collections::btree_map::BTreeMap, Pair};
41+
use sp_core::Pair;
4242
use sp_state_machine::{Backend as StateBackend, StorageValue};
4343

4444
/// The timeout in seconds after that the waiting for a block should be aborted.

cumulus/client/relay-chain-rpc-interface/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ use futures::{FutureExt, Stream, StreamExt};
3030
use polkadot_overseer::Handle;
3131

3232
use sc_client_api::StorageProof;
33-
use sp_core::sp_std::collections::btree_map::BTreeMap;
3433
use sp_state_machine::StorageValue;
3534
use sp_storage::StorageKey;
3635
use sp_version::RuntimeVersion;
37-
use std::pin::Pin;
36+
use std::{collections::btree_map::BTreeMap, pin::Pin};
3837

3938
use cumulus_primitives_core::relay_chain::BlockId;
4039
pub use url::Url;

cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use jsonrpsee::{
2424
};
2525
use serde::de::DeserializeOwned;
2626
use serde_json::Value as JsonValue;
27-
use std::collections::VecDeque;
27+
use std::collections::{btree_map::BTreeMap, VecDeque};
2828
use tokio::sync::mpsc::Sender as TokioSender;
2929

3030
use codec::{Decode, Encode};
@@ -47,7 +47,6 @@ use sc_client_api::StorageData;
4747
use sc_rpc_api::{state::ReadProof, system::Health};
4848
use sc_service::TaskManager;
4949
use sp_consensus_babe::Epoch;
50-
use sp_core::sp_std::collections::btree_map::BTreeMap;
5150
use sp_storage::StorageKey;
5251
use sp_version::RuntimeVersion;
5352

cumulus/pallets/aura-ext/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ pallet-timestamp = { workspace = true }
2121
sp-application-crypto = { workspace = true }
2222
sp-consensus-aura = { workspace = true }
2323
sp-runtime = { workspace = true }
24-
sp-std = { workspace = true }
2524

2625
# Cumulus
2726
cumulus-pallet-parachain-system = { workspace = true }
@@ -44,7 +43,6 @@ std = [
4443
"sp-application-crypto/std",
4544
"sp-consensus-aura/std",
4645
"sp-runtime/std",
47-
"sp-std/std",
4846
]
4947
try-runtime = [
5048
"cumulus-pallet-parachain-system/try-runtime",

cumulus/pallets/aura-ext/src/consensus_hook.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
//! The velocity `V` refers to the rate of block processing by the relay chain.
2121
2222
use super::{pallet, Aura};
23+
use core::{marker::PhantomData, num::NonZeroU32};
2324
use cumulus_pallet_parachain_system::{
2425
self as parachain_system,
2526
consensus_hook::{ConsensusHook, UnincludedSegmentCapacity},
2627
relay_state_snapshot::RelayChainStateProof,
2728
};
2829
use frame_support::pallet_prelude::*;
2930
use sp_consensus_aura::{Slot, SlotDuration};
30-
use sp_std::{marker::PhantomData, num::NonZeroU32};
3131

3232
/// A consensus hook for a fixed block processing velocity and unincluded segment capacity.
3333
///
@@ -84,7 +84,7 @@ where
8484

8585
(
8686
weight,
87-
NonZeroU32::new(sp_std::cmp::max(C, 1))
87+
NonZeroU32::new(core::cmp::max(C, 1))
8888
.expect("1 is the minimum value and non-zero; qed")
8989
.into(),
9090
)

cumulus/pallets/aura-ext/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub mod pallet {
109109
#[derive(frame_support::DefaultNoBound)]
110110
pub struct GenesisConfig<T: Config> {
111111
#[serde(skip)]
112-
pub _config: sp_std::marker::PhantomData<T>,
112+
pub _config: core::marker::PhantomData<T>,
113113
}
114114

115115
#[pallet::genesis_build]
@@ -125,7 +125,7 @@ pub mod pallet {
125125
///
126126
/// When executing the block it will verify the block seal to ensure that the correct author created
127127
/// the block.
128-
pub struct BlockExecutor<T, I>(sp_std::marker::PhantomData<(T, I)>);
128+
pub struct BlockExecutor<T, I>(core::marker::PhantomData<(T, I)>);
129129

130130
impl<Block, T, I> ExecuteBlock<Block> for BlockExecutor<T, I>
131131
where

cumulus/pallets/collator-selection/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ codec = { features = ["derive"], workspace = true }
2121
rand = { features = ["std_rng"], workspace = true }
2222
scale-info = { features = ["derive"], workspace = true }
2323

24-
sp-std = { workspace = true }
2524
sp-runtime = { workspace = true }
2625
sp-staking = { workspace = true }
2726
frame-support = { workspace = true }
@@ -65,7 +64,6 @@ std = [
6564
"scale-info/std",
6665
"sp-runtime/std",
6766
"sp-staking/std",
68-
"sp-std/std",
6967
]
7068

7169
try-runtime = [

cumulus/pallets/collator-selection/src/benchmarking.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ use super::*;
2121

2222
#[allow(unused)]
2323
use crate::Pallet as CollatorSelection;
24+
use alloc::vec::Vec;
2425
use codec::Decode;
26+
use core::cmp;
2527
use frame_benchmarking::{account, v2::*, whitelisted_caller, BenchmarkError};
2628
use frame_support::traits::{Currency, EnsureOrigin, Get, ReservableCurrency};
2729
use frame_system::{pallet_prelude::BlockNumberFor, EventRecord, RawOrigin};
2830
use pallet_authorship::EventHandler;
2931
use pallet_session::{self as session, SessionManager};
30-
use sp_std::{cmp, prelude::*};
3132

3233
pub type BalanceOf<T> =
3334
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;

0 commit comments

Comments
 (0)