mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 04:07:57 +00:00
Rename: primitives/sr-std -> primitives/sp-std (#4327)
* primitives/sr-std -> primitives/std * fix * fix conflict * rstd -> sp-std * git mv * fix review * fix merge
This commit is contained in:
@@ -6,7 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
wasm-interface = { package = "sp-wasm-interface", path = "../wasm-interface", optional = true }
|
||||
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
|
||||
sp-std = { path = "../std", default-features = false }
|
||||
sp-runtime-interface-proc-macro = { path = "proc-macro" }
|
||||
externalities = { package = "sp-externalities", path = "../externalities", optional = true }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.6", default-features = false }
|
||||
@@ -25,7 +25,7 @@ runtime-io = { package = "sp-io", path = "../sr-io" }
|
||||
default = [ "std" ]
|
||||
std = [
|
||||
"wasm-interface",
|
||||
"rstd/std",
|
||||
"sp-std/std",
|
||||
"codec/std",
|
||||
"externalities",
|
||||
"environmental",
|
||||
|
||||
@@ -50,10 +50,10 @@ pub fn derive_impl(input: DeriveInput) -> Result<TokenStream> {
|
||||
type PassBy = #crate_::pass_by::Enum<#ident>;
|
||||
}
|
||||
|
||||
impl #crate_::rstd::convert::TryFrom<u8> for #ident {
|
||||
impl #crate_::sp_std::convert::TryFrom<u8> for #ident {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(inner: u8) -> #crate_::rstd::result::Result<Self, ()> {
|
||||
fn try_from(inner: u8) -> #crate_::sp_std::result::Result<Self, ()> {
|
||||
match inner {
|
||||
#( #try_from_variants, )*
|
||||
_ => Err(()),
|
||||
|
||||
@@ -30,13 +30,13 @@ use wasm_interface::{FunctionContext, Result};
|
||||
|
||||
use codec::{Encode, Decode};
|
||||
|
||||
use rstd::{any::TypeId, mem, vec::Vec};
|
||||
use sp_std::{any::TypeId, mem, vec::Vec};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use rstd::borrow::Cow;
|
||||
use sp_std::borrow::Cow;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use rstd::{slice, boxed::Box};
|
||||
use sp_std::{slice, boxed::Box};
|
||||
|
||||
// Make sure that our assumptions for storing a pointer + its size in `u64` is valid.
|
||||
#[cfg(all(not(feature = "std"), not(feature = "disable_target_static_assertions")))]
|
||||
@@ -48,7 +48,7 @@ assert_eq_size!(*const u8, u32);
|
||||
pub fn pointer_and_len_to_u64(ptr: u32, len: u32) -> u64 {
|
||||
// The static assertions from above are changed into a runtime check.
|
||||
#[cfg(all(not(feature = "std"), feature = "disable_target_static_assertions"))]
|
||||
assert_eq!(4, rstd::mem::size_of::<usize>());
|
||||
assert_eq!(4, sp_std::mem::size_of::<usize>());
|
||||
|
||||
(u64::from(len) << 32) | u64::from(ptr)
|
||||
}
|
||||
@@ -57,7 +57,7 @@ pub fn pointer_and_len_to_u64(ptr: u32, len: u32) -> u64 {
|
||||
pub fn pointer_and_len_from_u64(val: u64) -> (u32, u32) {
|
||||
// The static assertions from above are changed into a runtime check.
|
||||
#[cfg(all(not(feature = "std"), feature = "disable_target_static_assertions"))]
|
||||
assert_eq!(4, rstd::mem::size_of::<usize>());
|
||||
assert_eq!(4, sp_std::mem::size_of::<usize>());
|
||||
|
||||
let ptr = (val & (!0u32 as u64)) as u32;
|
||||
let len = (val >> 32) as u32;
|
||||
@@ -373,7 +373,7 @@ impl_traits_for_arrays! {
|
||||
75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
|
||||
}
|
||||
|
||||
impl<T: codec::Codec, E: codec::Codec> PassBy for rstd::result::Result<T, E> {
|
||||
impl<T: codec::Codec, E: codec::Codec> PassBy for sp_std::result::Result<T, E> {
|
||||
type PassBy = Codec<Self>;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
pub use wasm_interface;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub use rstd;
|
||||
pub use sp_std;
|
||||
|
||||
pub use sp_runtime_interface_proc_macro::runtime_interface;
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ use crate::wasm::*;
|
||||
#[cfg(feature = "std")]
|
||||
use wasm_interface::{FunctionContext, Pointer, Result};
|
||||
|
||||
use rstd::{marker::PhantomData, convert::TryFrom};
|
||||
use sp_std::{marker::PhantomData, convert::TryFrom};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use rstd::{slice, vec::Vec};
|
||||
use sp_std::{slice, vec::Vec};
|
||||
|
||||
pub use sp_runtime_interface_proc_macro::{PassByCodec, PassByInner, PassByEnum};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use crate::RIType;
|
||||
|
||||
use rstd::cell::Cell;
|
||||
use sp_std::cell::Cell;
|
||||
|
||||
/// Something that can be created from a ffi value.
|
||||
///
|
||||
|
||||
@@ -7,7 +7,7 @@ build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
runtime-interface = { package = "sp-runtime-interface", path = "../", default-features = false }
|
||||
rstd = { package = "sp-std", path = "../../sr-std", default-features = false }
|
||||
sp-std = { path = "../../std", default-features = false }
|
||||
runtime-io = { package = "sp-io", path = "../../sr-io", default-features = false }
|
||||
primitives = { package = "sp-core", path = "../../core", default-features = false }
|
||||
|
||||
@@ -16,4 +16,4 @@ wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.
|
||||
|
||||
[features]
|
||||
default = [ "std" ]
|
||||
std = [ "runtime-interface/std", "rstd/std", "primitives/std", "runtime-io/std" ]
|
||||
std = [ "runtime-interface/std", "sp-std/std", "primitives/std", "runtime-io/std" ]
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
use runtime_interface::runtime_interface;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use rstd::{vec, vec::Vec, mem, convert::TryFrom};
|
||||
use sp_std::{vec, vec::Vec, mem, convert::TryFrom};
|
||||
|
||||
use primitives::{sr25519::Public, wasm_export_functions};
|
||||
|
||||
@@ -95,8 +95,8 @@ extern "C" {
|
||||
/// Make sure the old runtime interface needs to be imported.
|
||||
#[no_mangle]
|
||||
pub fn force_old_runtime_interface_import() {
|
||||
unsafe { ext_clear_storage(rstd::ptr::null(), 0); }
|
||||
unsafe { ext_keccak_256(rstd::ptr::null(), 0, rstd::ptr::null_mut()); }
|
||||
unsafe { ext_clear_storage(sp_std::ptr::null(), 0); }
|
||||
unsafe { ext_keccak_256(sp_std::ptr::null(), 0, sp_std::ptr::null_mut()); }
|
||||
}
|
||||
|
||||
/// This function is not used, but we require it for the compiler to include `runtime-io`.
|
||||
@@ -173,7 +173,7 @@ wasm_export_functions! {
|
||||
fn test_invalid_utf8_data_should_return_an_error() {
|
||||
let data = vec![0, 159, 146, 150];
|
||||
// I'm an evil hacker, trying to hack!
|
||||
let data_str = unsafe { rstd::str::from_utf8_unchecked(&data) };
|
||||
let data_str = unsafe { sp_std::str::from_utf8_unchecked(&data) };
|
||||
|
||||
test_api::invalid_utf8_data(data_str);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user