Jelajahi Sumber

Add no_std cfg attribute

Shamil Gadelshin 5 tahun lalu
induk
melakukan
72e2725dbc

+ 3 - 0
runtime-modules/governance/src/lib.rs

@@ -1,3 +1,6 @@
+// Ensure we're `no_std` when compiling for Wasm.
+#![cfg_attr(not(feature = "std"), no_std)]
+
 pub mod council;
 pub mod election;
 pub mod proposals;

+ 3 - 0
runtime-modules/membership/src/lib.rs

@@ -1,3 +1,6 @@
+// Ensure we're `no_std` when compiling for Wasm.
+#![cfg_attr(not(feature = "std"), no_std)]
+
 pub mod genesis;
 pub mod members;
 pub mod role_types;

+ 4 - 0
runtime-modules/memo/src/lib.rs

@@ -1,8 +1,12 @@
+// Ensure we're `no_std` when compiling for Wasm.
+#![cfg_attr(not(feature = "std"), no_std)]
+
 use crate::currency::GovernanceCurrency;
 use rstd::prelude::*;
 use sr_primitives::traits::Zero;
 use srml_support::traits::Currency;
 use srml_support::{decl_event, decl_module, decl_storage, ensure};
+
 use system::{self, ensure_signed};
 
 pub trait Trait: system::Trait + GovernanceCurrency {

+ 3 - 0
runtime-modules/roles/src/lib.rs

@@ -1,3 +1,6 @@
+// Ensure we're `no_std` when compiling for Wasm.
+#![cfg_attr(not(feature = "std"), no_std)]
+
 pub mod actors;
 
 mod mock;

+ 3 - 0
runtime-modules/service-discovery/src/lib.rs

@@ -1,3 +1,6 @@
+// Ensure we're `no_std` when compiling for Wasm.
+#![cfg_attr(not(feature = "std"), no_std)]
+
 pub mod discovery;
 
 mod mock;

+ 3 - 0
runtime-modules/storage/src/lib.rs

@@ -1,3 +1,6 @@
+// Ensure we're `no_std` when compiling for Wasm.
+#![cfg_attr(not(feature = "std"), no_std)]
+
 pub mod data_directory;
 pub mod data_object_storage_registry;
 pub mod data_object_type_registry;