sp-std removal from substrate/primitives (#3274)

This PR removes sp-std crate from substrate/primitives sub-directories.

For now crates that have `pub use` of sp-std or export macros that would
necessitate users of the macros to `extern crate alloc` have been
excluded from this PR.

There should be no breaking changes in this PR.

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
This commit is contained in:
Squirrel
2024-03-18 05:29:35 +00:00
committed by GitHub
parent 6b1179f13b
commit 1b5f4243d1
110 changed files with 254 additions and 278 deletions
+5 -2
View File
@@ -20,14 +20,17 @@
//! A crate which contains primitives that are useful for implementation that uses staking
//! approaches in general. Definitions related to sessions, slashing, etc go here.
extern crate alloc;
use crate::currency_to_vote::CurrencyToVote;
use alloc::{collections::btree_map::BTreeMap, vec, vec::Vec};
use codec::{Decode, Encode, FullCodec, HasCompact, MaxEncodedLen};
use core::ops::Sub;
use scale_info::TypeInfo;
use sp_runtime::{
traits::{AtLeast32BitUnsigned, Zero},
DispatchError, DispatchResult, RuntimeDebug, Saturating,
};
use sp_std::{collections::btree_map::BTreeMap, ops::Sub, vec, vec::Vec};
pub mod offence;
@@ -172,7 +175,7 @@ pub trait StakingInterface {
+ Saturating;
/// AccountId type used by the staking system.
type AccountId: Clone + sp_std::fmt::Debug;
type AccountId: Clone + core::fmt::Debug;
/// Means of converting Currency to VoteWeight.
type CurrencyToVote: CurrencyToVote<Self::Balance>;
+1 -1
View File
@@ -18,10 +18,10 @@
//! Common traits and types that are useful for describing offences for usage in environments
//! that use staking.
use alloc::vec::Vec;
use codec::{Decode, Encode};
use sp_core::Get;
use sp_runtime::{transaction_validity::TransactionValidityError, DispatchError, Perbill};
use sp_std::vec::Vec;
use crate::SessionIndex;