Skip to content

Commit

Permalink
Remove usage of sp-std on templates (paritytech#5001)
Browse files Browse the repository at this point in the history
Following PR for paritytech#4941
that removes usage of `sp-std` on templates

`sp-std` crate was proposed to deprecate on
paritytech#2101

@kianenigma

---------

Co-authored-by: Kian Paimani <[email protected]>
  • Loading branch information
2 people authored and TomaszWaszczyk committed Jul 13, 2024
1 parent 1aca3af commit c2043dc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 15 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: 0 additions & 2 deletions templates/parachain/pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ frame-system = { workspace = true }

# primitive deps
sp-runtime = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
sp-core = { workspace = true, default-features = true }
Expand All @@ -50,7 +49,6 @@ std = [
"frame-system/std",

"sp-runtime/std",
"sp-std/std",
]
try-runtime = [
"frame-support/try-runtime",
Expand Down
2 changes: 0 additions & 2 deletions templates/parachain/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ sp-inherents = { workspace = true }
sp-offchain = { workspace = true }
sp-runtime = { workspace = true }
sp-session = { workspace = true }
sp-std = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }

Expand Down Expand Up @@ -136,7 +135,6 @@ std = [
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
Expand Down
6 changes: 3 additions & 3 deletions templates/parachain/runtime/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// For more information, please refer to <http://unlicense.org>

// External crates imports
use alloc::vec::Vec;
use frame_support::{
genesis_builder_helper::{build_state, get_preset},
weights::Weight,
Expand All @@ -37,7 +38,6 @@ use sp_runtime::{
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult,
};
use sp_std::prelude::Vec;
use sp_version::RuntimeVersion;

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

fn metadata_versions() -> sp_std::vec::Vec<u32> {
fn metadata_versions() -> Vec<u32> {
Runtime::metadata_versions()
}
}
Expand Down Expand Up @@ -264,7 +264,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: &Vec<u8>) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion templates/parachain/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ mod benchmarks;
mod configs;
mod weights;

extern crate alloc;
use alloc::{boxed::Box, vec::Vec};
use smallvec::smallvec;
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
traits::{BlakeTwo256, IdentifyAccount, Verify},
MultiSignature,
};

use sp_std::prelude::*;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
Expand Down
2 changes: 0 additions & 2 deletions templates/solochain/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ sp-runtime = { features = [
"serde",
], workspace = true }
sp-session = { workspace = true }
sp-std = { workspace = true }
sp-storage = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { features = [
Expand Down Expand Up @@ -109,7 +108,6 @@ std = [
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
"sp-storage/std",
"sp-transaction-pool/std",
"sp-version/std",
Expand Down
5 changes: 3 additions & 2 deletions templates/solochain/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

extern crate alloc;
use alloc::{boxed::Box, vec, vec::Vec};
use pallet_grandpa::AuthorityId as GrandpaId;
use sp_api::impl_runtime_apis;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
Expand All @@ -13,7 +15,6 @@ use sp_runtime::{
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult, MultiSignature,
};
use sp_std::prelude::*;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
Expand Down Expand Up @@ -370,7 +371,7 @@ impl_runtime_apis! {
Runtime::metadata_at_version(version)
}

fn metadata_versions() -> sp_std::vec::Vec<u32> {
fn metadata_versions() -> Vec<u32> {
Runtime::metadata_versions()
}
}
Expand Down

0 comments on commit c2043dc

Please sign in to comment.