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
@@ -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)