pallet macro: always generate storage info on pallet struct (#9246)

* always implement storage info on Pallet

* fix UI test

* Fold span computation into trait and method computation

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
Guillaume Thiolliere
2021-07-05 13:23:43 +02:00
committed by GitHub
parent f93074d086
commit f96c5df754
13 changed files with 338 additions and 35 deletions
@@ -397,6 +397,9 @@ pub mod pallet2 {
{
}
#[pallet::storage]
pub type SomeValue<T: Config> = StorageValue<_, Vec<u32>>;
#[pallet::event]
pub enum Event {
/// Something
@@ -1247,4 +1250,15 @@ fn test_storage_info() {
},
],
);
assert_eq!(
Example2::storage_info(),
vec![
StorageInfo {
prefix: prefix(b"Example2", b"SomeValue"),
max_values: Some(1),
max_size: None,
},
],
);
}