Require MaxEncodedLen per default (#10662)

* Remove generate_storage_info

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add without_storage_info where needed

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update doc tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add more without_storage_info

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fix TryBuild

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fix TryBuild tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2022-01-20 12:16:04 +01:00
committed by GitHub
parent 6b60c3dbff
commit 362a6d9b28
64 changed files with 127 additions and 109 deletions
-1
View File
@@ -172,7 +172,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T, I = ()>(_);
#[pallet::config]
+1
View File
@@ -182,6 +182,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::storage]
-1
View File
@@ -81,7 +81,6 @@ pub mod pallet {
}
#[pallet::pallet]
#[pallet::generate_storage_info]
pub struct Pallet<T>(sp_std::marker::PhantomData<T>);
#[pallet::hooks]
@@ -39,7 +39,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
+1
View File
@@ -156,6 +156,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::hooks]
-1
View File
@@ -115,7 +115,6 @@ pub mod pallet {
/// The BABE Pallet
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
-1
View File
@@ -92,7 +92,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(crate) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
-1
View File
@@ -242,7 +242,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::call]
+1
View File
@@ -119,6 +119,7 @@ pub mod pallet {
/// BEEFY-MMR pallet.
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
/// The module's configuration trait.
+1
View File
@@ -51,6 +51,7 @@ pub mod pallet {
}
#[pallet::pallet]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::hooks]
+1
View File
@@ -180,6 +180,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
@@ -130,7 +130,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
+1
View File
@@ -172,6 +172,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::config]
+1
View File
@@ -303,6 +303,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::hooks]
+1
View File
@@ -246,6 +246,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
@@ -1205,6 +1205,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
}
@@ -250,6 +250,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::hooks]
@@ -158,6 +158,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::hooks]
@@ -48,6 +48,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
/// A public part of the pallet.
+1
View File
@@ -178,6 +178,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
/// A single bid on a gilt, an item of a *queue* in `Queues`.
-1
View File
@@ -83,7 +83,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
-1
View File
@@ -152,7 +152,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
/// Information that is pertinent to identify the entity behind an account.
-1
View File
@@ -315,7 +315,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
+1
View File
@@ -74,6 +74,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::call]
-1
View File
@@ -124,7 +124,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
/// The pallet's config trait.
+1
View File
@@ -46,6 +46,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::config]
@@ -84,6 +84,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
/// This pallet's configuration trait
+1
View File
@@ -153,6 +153,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
/// The set of open multisig operations.
+1
View File
@@ -114,6 +114,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::call]
@@ -57,6 +57,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
/// The module configuration trait
+1
View File
@@ -50,6 +50,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
/// The pallet's config trait.
-1
View File
@@ -100,7 +100,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::event]
-1
View File
@@ -102,7 +102,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
/// Configuration trait.
@@ -91,6 +91,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
+1
View File
@@ -212,6 +212,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
/// Configuration trait.
+1
View File
@@ -203,6 +203,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
/// `system::Config` should always be included in our implied traits.
+1
View File
@@ -129,6 +129,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(_);
#[pallet::config]
+1
View File
@@ -373,6 +373,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
+1
View File
@@ -371,6 +371,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(_);
#[pallet::config]
@@ -56,6 +56,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(crate) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
-1
View File
@@ -121,7 +121,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::call]
+1
View File
@@ -45,6 +45,7 @@ pub mod logger {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::call]
@@ -99,19 +99,19 @@ pub fn expand_pallet_struct(def: &mut Def) -> proc_macro2::TokenStream {
};
let storage_info_span =
def.pallet_struct.generate_storage_info.unwrap_or(def.pallet_struct.attr_span);
def.pallet_struct.without_storage_info.unwrap_or(def.pallet_struct.attr_span);
let storage_names = &def.storages.iter().map(|storage| &storage.ident).collect::<Vec<_>>();
let storage_cfg_attrs =
&def.storages.iter().map(|storage| &storage.cfg_attrs).collect::<Vec<_>>();
// Depending on the flag `generate_storage_info` and the storage attribute `unbounded`, we use
// Depending on the flag `without_storage_info` and the storage attribute `unbounded`, we use
// partial or full storage info from storage.
let storage_info_traits = &def
.storages
.iter()
.map(|storage| {
if storage.unbounded || def.pallet_struct.generate_storage_info.is_none() {
if storage.unbounded || def.pallet_struct.without_storage_info.is_some() {
quote::quote_spanned!(storage_info_span => PartialStorageInfoTrait)
} else {
quote::quote_spanned!(storage_info_span => StorageInfoTrait)
@@ -123,7 +123,7 @@ pub fn expand_pallet_struct(def: &mut Def) -> proc_macro2::TokenStream {
.storages
.iter()
.map(|storage| {
if storage.unbounded || def.pallet_struct.generate_storage_info.is_none() {
if storage.unbounded || def.pallet_struct.without_storage_info.is_some() {
quote::quote_spanned!(storage_info_span => partial_storage_info)
} else {
quote::quote_spanned!(storage_info_span => storage_info)
@@ -24,7 +24,7 @@ mod keyword {
syn::custom_keyword!(pallet);
syn::custom_keyword!(Pallet);
syn::custom_keyword!(generate_store);
syn::custom_keyword!(generate_storage_info);
syn::custom_keyword!(without_storage_info);
syn::custom_keyword!(storage_version);
syn::custom_keyword!(Store);
}
@@ -43,18 +43,18 @@ pub struct PalletStructDef {
pub attr_span: proc_macro2::Span,
/// Whether to specify the storages max encoded len when implementing `StorageInfoTrait`.
/// Contains the span of the attribute.
pub generate_storage_info: Option<proc_macro2::Span>,
pub without_storage_info: Option<proc_macro2::Span>,
/// The current storage version of the pallet.
pub storage_version: Option<syn::Path>,
}
/// Parse for one variant of:
/// * `#[pallet::generate_store($vis trait Store)]`
/// * `#[pallet::generate_storage_info]`
/// * `#[pallet::without_storage_info]`
/// * `#[pallet::storage_version(STORAGE_VERSION)]`
pub enum PalletStructAttr {
GenerateStore { span: proc_macro2::Span, vis: syn::Visibility, keyword: keyword::Store },
GenerateStorageInfoTrait(proc_macro2::Span),
WithoutStorageInfoTrait(proc_macro2::Span),
StorageVersion { storage_version: syn::Path, span: proc_macro2::Span },
}
@@ -62,7 +62,7 @@ impl PalletStructAttr {
fn span(&self) -> proc_macro2::Span {
match self {
Self::GenerateStore { span, .. } => *span,
Self::GenerateStorageInfoTrait(span) => *span,
Self::WithoutStorageInfoTrait(span) => *span,
Self::StorageVersion { span, .. } => *span,
}
}
@@ -86,9 +86,9 @@ impl syn::parse::Parse for PalletStructAttr {
generate_content.parse::<syn::Token![trait]>()?;
let keyword = generate_content.parse::<keyword::Store>()?;
Ok(Self::GenerateStore { vis, keyword, span })
} else if lookahead.peek(keyword::generate_storage_info) {
let span = content.parse::<keyword::generate_storage_info>()?.span();
Ok(Self::GenerateStorageInfoTrait(span))
} else if lookahead.peek(keyword::without_storage_info) {
let span = content.parse::<keyword::without_storage_info>()?.span();
Ok(Self::WithoutStorageInfoTrait(span))
} else if lookahead.peek(keyword::storage_version) {
let span = content.parse::<keyword::storage_version>()?.span();
@@ -117,7 +117,7 @@ impl PalletStructDef {
};
let mut store = None;
let mut generate_storage_info = None;
let mut without_storage_info = None;
let mut storage_version_found = None;
let struct_attrs: Vec<PalletStructAttr> = helper::take_item_pallet_attrs(&mut item.attrs)?;
@@ -126,10 +126,10 @@ impl PalletStructDef {
PalletStructAttr::GenerateStore { vis, keyword, .. } if store.is_none() => {
store = Some((vis, keyword));
},
PalletStructAttr::GenerateStorageInfoTrait(span)
if generate_storage_info.is_none() =>
PalletStructAttr::WithoutStorageInfoTrait(span)
if without_storage_info.is_none() =>
{
generate_storage_info = Some(span);
without_storage_info = Some(span);
},
PalletStructAttr::StorageVersion { storage_version, .. }
if storage_version_found.is_none() =>
@@ -164,7 +164,7 @@ impl PalletStructDef {
pallet,
store,
attr_span,
generate_storage_info,
without_storage_info,
storage_version: storage_version_found,
})
}
+2 -2
View File
@@ -1967,7 +1967,7 @@ pub mod pallet_prelude {
/// pub trait Config: frame_system::Config {
/// #[pallet::constant] // put the constant in metadata
/// type MyGetParam: Get<u32>;
/// type Balance: Parameter + From<u8>;
/// type Balance: Parameter + MaxEncodedLen + From<u8>;
/// type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
/// }
///
@@ -2156,7 +2156,7 @@ pub mod pallet_prelude {
/// pub trait Config<I: 'static = ()>: frame_system::Config {
/// #[pallet::constant]
/// type MyGetParam: Get<u32>;
/// type Balance: Parameter + From<u8>;
/// type Balance: Parameter + MaxEncodedLen + From<u8>;
/// type Event: From<Event<Self, I>> + IsType<<Self as frame_system::Config>::Event>;
/// }
///
+1 -1
View File
@@ -156,7 +156,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(crate) trait Store)]
#[pallet::generate_storage_info]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(_);
@@ -450,6 +449,7 @@ pub mod pallet2 {
#[pallet::pallet]
#[pallet::generate_store(pub(crate) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::hooks]
@@ -124,6 +124,7 @@ pub mod pallet {
}
#[pallet::pallet]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::hooks]
@@ -109,6 +109,7 @@ pub mod pallet {
}
#[pallet::pallet]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::hooks]
@@ -7,6 +7,7 @@ mod pallet {
pub trait Config: frame_system::Config {}
#[pallet::pallet]
#[pallet::without_storage_info]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
@@ -1,97 +1,97 @@
error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen.rs:9:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:10:12
|
9 | #[pallet::pallet]
| ^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar`
10 | #[pallet::without_storage_info]
| ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `Decode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `PartialStorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `partial_storage_info`
--> $DIR/storage.rs:88:2
--> $WORKSPACE/frame/support/src/traits/storage.rs
|
88 | fn partial_storage_info() -> Vec<StorageInfo>;
| fn partial_storage_info() -> Vec<StorageInfo>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen.rs:9:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:10:12
|
9 | #[pallet::pallet]
| ^^^^^^ the trait `EncodeLike` is not implemented for `Bar`
10 | #[pallet::without_storage_info]
| ^^^^^^^^^^^^^^^^^^^^ the trait `EncodeLike` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `FullEncode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `PartialStorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `partial_storage_info`
--> $DIR/storage.rs:88:2
--> $WORKSPACE/frame/support/src/traits/storage.rs
|
88 | fn partial_storage_info() -> Vec<StorageInfo>;
| fn partial_storage_info() -> Vec<StorageInfo>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen.rs:9:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:10:12
|
9 | #[pallet::pallet]
| ^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar`
10 | #[pallet::without_storage_info]
| ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `Encode` for `Bar`
= note: required because of the requirements on the impl of `FullEncode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `PartialStorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `partial_storage_info`
--> $DIR/storage.rs:88:2
--> $WORKSPACE/frame/support/src/traits/storage.rs
|
88 | fn partial_storage_info() -> Vec<StorageInfo>;
| fn partial_storage_info() -> Vec<StorageInfo>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: TypeInfo` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen.rs:20:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:21:12
|
20 | #[pallet::storage]
21 | #[pallet::storage]
| ^^^^^^^ the trait `TypeInfo` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `StaticTypeInfo` for `Bar`
= note: required because of the requirements on the impl of `StorageEntryMetadataBuilder` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `build_metadata`
--> $DIR/mod.rs:113:2
--> $WORKSPACE/frame/support/src/storage/types/mod.rs
|
113 | fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen.rs:20:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:21:12
|
20 | #[pallet::storage]
21 | #[pallet::storage]
| ^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `Decode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `StorageEntryMetadataBuilder` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `build_metadata`
--> $DIR/mod.rs:113:2
--> $WORKSPACE/frame/support/src/storage/types/mod.rs
|
113 | fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen.rs:20:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:21:12
|
20 | #[pallet::storage]
21 | #[pallet::storage]
| ^^^^^^^ the trait `EncodeLike` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `FullEncode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `StorageEntryMetadataBuilder` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `build_metadata`
--> $DIR/mod.rs:113:2
--> $WORKSPACE/frame/support/src/storage/types/mod.rs
|
113 | fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen.rs:20:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.rs:21:12
|
20 | #[pallet::storage]
21 | #[pallet::storage]
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `Encode` for `Bar`
@@ -99,7 +99,7 @@ error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `StorageEntryMetadataBuilder` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `build_metadata`
--> $DIR/mod.rs:113:2
--> $WORKSPACE/frame/support/src/storage/types/mod.rs
|
113 | fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,6 +7,7 @@ mod pallet {
pub trait Config: frame_system::Config {}
#[pallet::pallet]
#[pallet::without_storage_info]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
@@ -1,97 +1,97 @@
error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:9:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:10:12
|
9 | #[pallet::pallet]
| ^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar`
10 | #[pallet::without_storage_info]
| ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `Decode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `PartialStorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `partial_storage_info`
--> $DIR/storage.rs:88:2
--> $WORKSPACE/frame/support/src/traits/storage.rs
|
88 | fn partial_storage_info() -> Vec<StorageInfo>;
| fn partial_storage_info() -> Vec<StorageInfo>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:9:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:10:12
|
9 | #[pallet::pallet]
| ^^^^^^ the trait `EncodeLike` is not implemented for `Bar`
10 | #[pallet::without_storage_info]
| ^^^^^^^^^^^^^^^^^^^^ the trait `EncodeLike` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `FullEncode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `PartialStorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `partial_storage_info`
--> $DIR/storage.rs:88:2
--> $WORKSPACE/frame/support/src/traits/storage.rs
|
88 | fn partial_storage_info() -> Vec<StorageInfo>;
| fn partial_storage_info() -> Vec<StorageInfo>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:9:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:10:12
|
9 | #[pallet::pallet]
| ^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar`
10 | #[pallet::without_storage_info]
| ^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `Encode` for `Bar`
= note: required because of the requirements on the impl of `FullEncode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `PartialStorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `partial_storage_info`
--> $DIR/storage.rs:88:2
--> $WORKSPACE/frame/support/src/traits/storage.rs
|
88 | fn partial_storage_info() -> Vec<StorageInfo>;
| fn partial_storage_info() -> Vec<StorageInfo>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: TypeInfo` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:20:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:21:12
|
20 | #[pallet::storage]
21 | #[pallet::storage]
| ^^^^^^^ the trait `TypeInfo` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `StaticTypeInfo` for `Bar`
= note: required because of the requirements on the impl of `StorageEntryMetadataBuilder` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `build_metadata`
--> $DIR/mod.rs:113:2
--> $WORKSPACE/frame/support/src/storage/types/mod.rs
|
113 | fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: WrapperTypeDecode` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:20:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:21:12
|
20 | #[pallet::storage]
21 | #[pallet::storage]
| ^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `Decode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `StorageEntryMetadataBuilder` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `build_metadata`
--> $DIR/mod.rs:113:2
--> $WORKSPACE/frame/support/src/storage/types/mod.rs
|
113 | fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: EncodeLike` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:20:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:21:12
|
20 | #[pallet::storage]
21 | #[pallet::storage]
| ^^^^^^^ the trait `EncodeLike` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `FullEncode` for `Bar`
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `StorageEntryMetadataBuilder` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `build_metadata`
--> $DIR/mod.rs:113:2
--> $WORKSPACE/frame/support/src/storage/types/mod.rs
|
113 | fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied
--> $DIR/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:20:12
--> tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.rs:21:12
|
20 | #[pallet::storage]
21 | #[pallet::storage]
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `Encode` for `Bar`
@@ -99,7 +99,7 @@ error[E0277]: the trait bound `Bar: WrapperTypeEncode` is not satisfied
= note: required because of the requirements on the impl of `FullCodec` for `Bar`
= note: required because of the requirements on the impl of `StorageEntryMetadataBuilder` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `build_metadata`
--> $DIR/mod.rs:113:2
--> $WORKSPACE/frame/support/src/storage/types/mod.rs
|
113 | fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| fn build_metadata(doc: Vec<&'static str>, entries: &mut Vec<StorageEntryMetadata>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,6 @@ mod pallet {
pub trait Config: frame_system::Config {}
#[pallet::pallet]
#[pallet::generate_storage_info]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
@@ -1,12 +1,12 @@
error[E0277]: the trait bound `Bar: MaxEncodedLen` is not satisfied
--> $DIR/storage_info_unsatisfied.rs:10:12
--> tests/pallet_ui/storage_info_unsatisfied.rs:9:12
|
10 | #[pallet::generate_storage_info]
| ^^^^^^^^^^^^^^^^^^^^^ the trait `MaxEncodedLen` is not implemented for `Bar`
9 | #[pallet::pallet]
| ^^^^^^ the trait `MaxEncodedLen` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageValue<_GeneratedPrefixForStorageFoo<T>, Bar>`
note: required by `storage_info`
--> $DIR/storage.rs:71:2
--> $WORKSPACE/frame/support/src/traits/storage.rs
|
71 | fn storage_info() -> Vec<StorageInfo>;
| fn storage_info() -> Vec<StorageInfo>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10,7 +10,6 @@ mod pallet {
pub trait Config: frame_system::Config {}
#[pallet::pallet]
#[pallet::generate_storage_info]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pallet::hooks]
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `Bar: MaxEncodedLen` is not satisfied
--> tests/pallet_ui/storage_info_unsatisfied_nmap.rs:13:12
--> tests/pallet_ui/storage_info_unsatisfied_nmap.rs:12:12
|
13 | #[pallet::generate_storage_info]
| ^^^^^^^^^^^^^^^^^^^^^ the trait `MaxEncodedLen` is not implemented for `Bar`
12 | #[pallet::pallet]
| ^^^^^^ the trait `MaxEncodedLen` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `KeyGeneratorMaxEncodedLen` for `Key<frame_support::Twox64Concat, Bar>`
= note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageNMap<_GeneratedPrefixForStorageFoo<T>, Key<frame_support::Twox64Concat, Bar>, u32>`
+1
View File
@@ -351,6 +351,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub (super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::hooks]
-1
View File
@@ -148,7 +148,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(PhantomData<T>);
/// Current time for the current block.
+1
View File
@@ -120,6 +120,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
@@ -248,6 +248,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::config]
@@ -129,6 +129,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
#[pallet::hooks]
-1
View File
@@ -139,7 +139,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pallet::config]
+1
View File
@@ -62,6 +62,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(_);
#[pallet::config]
-1
View File
@@ -203,7 +203,6 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::generate_storage_info]
pub struct Pallet<T>(_);
#[pallet::genesis_config]