Remove generation of instance trait by decl_storage. (#6812)

* remove generation of instance trait, no breaking change

* doc

* doc

* Update frame/support/src/traits.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/support/procedural/src/storage/instance_trait.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Guillaume Thiolliere
2020-08-05 13:37:01 +02:00
committed by GitHub
parent e4e0e79ad7
commit 8a37f60844
7 changed files with 54 additions and 40 deletions
@@ -324,7 +324,16 @@ fn get_module_instance(
instantiable: Option<syn::Ident>,
default_instance: Option<syn::Ident>,
) -> syn::Result<Option<super::ModuleInstanceDef>> {
let right_syntax = "Should be $Instance: $Instantiable = $DefaultInstance";
let right_syntax = "Should be $I: $Instance = $DefaultInstance";
if instantiable.as_ref().map_or(false, |i| i != "Instance") {
let msg = format!(
"Instance trait must be named `Instance`, other names are no longer supported, because \
it is now defined at frame_support::traits::Instance. Expect `Instance` found `{}`",
instantiable.as_ref().unwrap(),
);
return Err(syn::Error::new(instantiable.span(), msg));
}
match (instance, instantiable, default_instance) {
(Some(instance), Some(instantiable), default_instance) => {