add query types to generate_storage_alias (#9659)

* add query types to generate_storage_alias

* adjust comment

* use ValueQuery explicitly for generate_storage_alias with generic value type

* bump impl_version

* adjust line width and add import

* more compilation and formatting fixes

* formatting
This commit is contained in:
Alexander Popiak
2021-09-08 10:48:49 +02:00
committed by GitHub
parent bd2aa79112
commit 8cf6474388
4 changed files with 60 additions and 15 deletions
@@ -19,6 +19,7 @@
use codec::{Decode, Encode, FullCodec};
use frame_support::{
pallet_prelude::ValueQuery,
traits::{PalletInfoAccess, StorageVersion},
weights::Weight,
RuntimeDebug, Twox64Concat,
@@ -52,13 +53,22 @@ pub trait V2ToV3 {
}
frame_support::generate_storage_alias!(
PhragmenElection, Candidates<T: V2ToV3> => Value<Vec<(T::AccountId, T::Balance)>>
PhragmenElection, Candidates<T: V2ToV3> => Value<
Vec<(T::AccountId, T::Balance)>,
ValueQuery
>
);
frame_support::generate_storage_alias!(
PhragmenElection, Members<T: V2ToV3> => Value<Vec<SeatHolder<T::AccountId, T::Balance>>>
PhragmenElection, Members<T: V2ToV3> => Value<
Vec<SeatHolder<T::AccountId, T::Balance>>,
ValueQuery
>
);
frame_support::generate_storage_alias!(
PhragmenElection, RunnersUp<T: V2ToV3> => Value<Vec<SeatHolder<T::AccountId, T::Balance>>>
PhragmenElection, RunnersUp<T: V2ToV3> => Value<
Vec<SeatHolder<T::AccountId, T::Balance>>,
ValueQuery
>
);
frame_support::generate_storage_alias!(
PhragmenElection, Voting<T: V2ToV3> => Map<