mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 19:21:03 +00:00
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:
committed by
GitHub
parent
6b60c3dbff
commit
362a6d9b28
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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>;
|
||||
/// }
|
||||
///
|
||||
|
||||
@@ -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]
|
||||
|
||||
+1
@@ -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]
|
||||
|
||||
+31
-31
@@ -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>);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
+1
@@ -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]
|
||||
|
||||
+31
-31
@@ -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>`
|
||||
|
||||
Reference in New Issue
Block a user