Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
gilescope committed May 5, 2024
1 parent d5d1fe5 commit 4646ce2
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 31 deletions.
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bridges/snowbridge/pallets/ethereum-client/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use frame_support::{derive_impl, dispatch::DispatchResult, parameter_types};
use pallet_timestamp;
use primitives::{Fork, ForkVersions};
use snowbridge_core::inbound::{Log, Proof};
use sp_std::default::Default;
use core::default::Default;
use std::{fs::File, path::PathBuf};

type Block = frame_system::mocking::MockBlock<Test>;
Expand Down
6 changes: 1 addition & 5 deletions polkadot/primitives/src/runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,9 @@ use crate::{
SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, ValidatorSignature,
};

use alloc::{collections::btree_map::BTreeMap, vec::Vec};
use alloc::{collections::{btree_map::BTreeMap, vec_deque::VecDeque}, vec::Vec};
use polkadot_core_primitives as pcp;
use polkadot_parachain_primitives::primitives as ppp;
use sp_std::{
collections::{btree_map::BTreeMap, vec_deque::VecDeque},
prelude::*,
};

sp_api::decl_runtime_apis! {
/// The API for querying the state of parachains on-chain.
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/common/src/paras_registrar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use parity_scale_codec::{Decode, Encode};
use primitives::{HeadData, Id as ParaId, ValidationCode, LOWEST_PUBLIC_ID, MIN_CODE_SIZE};
use runtime_parachains::{
configuration, ensure_parachain,
paras::{self, ParaGenesisArgs, UpgradeStrategy},
paras::{self, OnNewHead, ParaGenesisArgs, ParaKind, UpgradeStrategy},
Origin, ParaLifecycle,
};
use scale_info::TypeInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use frame_support::{

mod v0 {
use super::*;
use sp_std::collections::vec_deque::VecDeque;
use alloc::collections::vec_deque::VecDeque;

#[derive(Encode, Decode, TypeInfo, Debug, PartialEq, Clone)]
pub(super) struct EnqueuedOrder {
Expand All @@ -50,7 +50,7 @@ mod v1 {
use crate::assigner_on_demand::LOG_TARGET;

/// Migration to V1
pub struct UncheckedMigrateToV1<T>(sp_std::marker::PhantomData<T>);
pub struct UncheckedMigrateToV1<T>(core::marker::PhantomData<T>);
impl<T: Config> UncheckedOnRuntimeUpgrade for UncheckedMigrateToV1<T> {
fn on_runtime_upgrade() -> Weight {
let mut weight: Weight = Weight::zero();
Expand Down
4 changes: 2 additions & 2 deletions polkadot/runtime/parachains/src/inclusion/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ mod v1 {
};
use frame_support::{traits::UncheckedOnRuntimeUpgrade, weights::Weight};
use sp_core::Get;
use sp_std::{collections::vec_deque::VecDeque, vec::Vec};
use alloc::{collections::vec_deque::VecDeque, vec::Vec};

#[cfg(feature = "try-runtime")]
use frame_support::{
Expand All @@ -85,7 +85,7 @@ mod v1 {
#[cfg(feature = "try-runtime")]
use parity_scale_codec::{Decode, Encode};

pub struct VersionUncheckedMigrateToV1<T>(sp_std::marker::PhantomData<T>);
pub struct VersionUncheckedMigrateToV1<T>(core::marker::PhantomData<T>);

impl<T: Config> UncheckedOnRuntimeUpgrade for VersionUncheckedMigrateToV1<T> {
#[cfg(feature = "try-runtime")]
Expand Down
2 changes: 0 additions & 2 deletions polkadot/xcm/xcm-fee-payment-runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ scale-info = { version = "2.11.1", default-features = false, features = [
"derive",
"serde",
] }
sp-std = { path = "../../../substrate/primitives/std", default-features = false }
sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
sp-weights = { path = "../../../substrate/primitives/weights", default-features = false }
xcm = { package = "staging-xcm", path = "../", default-features = false }
Expand All @@ -34,7 +33,6 @@ std = [
"scale-info/std",
"sp-api/std",
"sp-runtime/std",
"sp-std/std",
"sp-weights/std",
"xcm/std",
]
5 changes: 4 additions & 1 deletion polkadot/xcm/xcm-fee-payment-runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
#![cfg_attr(not(feature = "std"), no_std)]

extern crate alloc;

use codec::{Decode, Encode};
use frame_support::pallet_prelude::TypeInfo;
use sp_std::vec::Vec;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use sp_weights::Weight;
use xcm::{Version, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mod v0 {
///
/// In this migration, update the on-chain storage for the pallet to reflect the new storage
/// layout.
pub struct InnerMigrateV0ToV1<T: crate::Config>(sp_std::marker::PhantomData<T>);
pub struct InnerMigrateV0ToV1<T: crate::Config>(core::marker::PhantomData<T>);

impl<T: crate::Config> UncheckedOnRuntimeUpgrade for InnerMigrateV0ToV1<T> {
/// Return the existing [`crate::Value`] so we can check that it was correctly set in
Expand Down
2 changes: 0 additions & 2 deletions substrate/primitives/arithmetic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ num-traits = { version = "0.2.17", default-features = false }
scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
serde = { features = ["alloc", "derive"], optional = true, workspace = true }
static_assertions = "1.1.0"
sp-std = { path = "../std", default-features = false }
docify = "0.2.8"

[dev-dependencies]
Expand All @@ -43,7 +42,6 @@ std = [
"scale-info/std",
"serde/std",
"sp-crypto-hashing/std",
"sp-std/std",
]
# Serde support without relying on std features.
serde = ["dep:serde", "scale-info/serde"]
Expand Down
12 changes: 6 additions & 6 deletions substrate/primitives/core/src/crypto_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::crypto::Ss58Codec;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};

#[cfg(all(not(feature = "std"), feature = "serde"))]
use sp_std::alloc::{format, string::String};
use alloc::{format, string::String};

pub use public_bytes::*;
pub use signature_bytes::*;
Expand Down Expand Up @@ -256,7 +256,7 @@ mod public_bytes {

impl<const N: usize, SubTag> Public for PublicBytes<N, SubTag> where Self: CryptoType {}

impl<const N: usize, SubTag> sp_std::fmt::Debug for PublicBytes<N, SubTag>
impl<const N: usize, SubTag> core::fmt::Debug for PublicBytes<N, SubTag>
where
Self: CryptoType,
{
Expand All @@ -267,7 +267,7 @@ mod public_bytes {
}

#[cfg(not(feature = "std"))]
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
fn fmt(&self, _: &mut core::fmt::Formatter) -> core::fmt::Result {
Ok(())
}
}
Expand Down Expand Up @@ -362,17 +362,17 @@ mod signature_bytes {
}
}

impl<const N: usize, SubTag> sp_std::fmt::Debug for SignatureBytes<N, SubTag>
impl<const N: usize, SubTag> core::fmt::Debug for SignatureBytes<N, SubTag>
where
Self: CryptoType,
{
#[cfg(feature = "std")]
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{}", crate::hexdisplay::HexDisplay::from(&&self.0[..]))
}

#[cfg(not(feature = "std"))]
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
fn fmt(&self, _: &mut core::fmt::Formatter) -> core::fmt::Result {
Ok(())
}
}
Expand Down
2 changes: 0 additions & 2 deletions substrate/primitives/core/src/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ use secp256k1::{
ecdsa::{RecoverableSignature, RecoveryId},
Message, PublicKey, SecretKey, SECP256K1,
};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// An identifier used to match public keys against ecdsa keys
pub const CRYPTO_ID: CryptoTypeId = CryptoTypeId(*b"ecds");
Expand Down
7 changes: 4 additions & 3 deletions templates/parachain/runtime/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ use sp_runtime::{
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult,
};
use sp_std::prelude::Vec;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use sp_version::RuntimeVersion;

// Local module imports
Expand Down Expand Up @@ -80,7 +81,7 @@ impl_runtime_apis! {
Runtime::metadata_at_version(version)
}

fn metadata_versions() -> sp_std::vec::Vec<u32> {
fn metadata_versions() -> alloc::vec::Vec<u32> {
Runtime::metadata_versions()
}
}
Expand Down Expand Up @@ -238,7 +239,7 @@ impl_runtime_apis! {

use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &sp_std::vec::Vec<u8>) -> Result<(), BenchmarkError> {
fn setup_set_code_requirements(code: &alloc::vec::Vec<u8>) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
Ok(())
}
Expand Down

0 comments on commit 4646ce2

Please sign in to comment.