You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
When trying to use the decl_storage macro and build to wasm, the compiler complains that the Vec type has not been declared.
For example, this minimum runtime:
use srml_support::{StorageValue, dispatch::Result};
pub trait Trait: system::Trait {}
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
fn set_value(_origin, value: u32) -> Result {
<Value<T>>::put(value);
Ok(())
}
}
}
decl_storage! {
trait Store for Module<T: Trait> as RuntimeExampleStorage {
Value: u32;
}
}
will give the following error:
error[E0412]: cannot find type `Vec` in this scope
--> src/runtime_example.rs:13:1
|
13 | / decl_storage! {
14 | | trait Store for Module<T: Trait> as RuntimeExampleStorage {
15 | | Value: u32;
16 | | }
17 | | }
| |_^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
1 | use rstd::alloc::prelude::Vec;
|
1 | use rstd::prelude::Vec;
|
1 | use rstd::vec::Vec;
|
1 | use srml_support::dispatch::Vec;
|
and 1 other candidates
error: aborting due to previous error
For more information about this error, try `rustc --explain E0412`.
error: Could not compile `runtime-example-runtime`.
To solve this issue, you simply need to add: use rstd::prelude::*;
We should have the decl_storage macro automatically do this if it requires this import.
The text was updated successfully, but these errors were encountered:
When trying to use the decl_storage macro and build to wasm, the compiler complains that the Vec type has not been declared.
For example, this minimum runtime:
will give the following error:
To solve this issue, you simply need to add:
use rstd::prelude::*;
We should have the decl_storage macro automatically do this if it requires this import.
The text was updated successfully, but these errors were encountered: