Storage:
#[pallet::storage]
#[pallet::getter(fn voting)]
pub type Voting<T: Config> =
StorageMap<_, Twox64Concat, T::AccountId, Voter<T::AccountId>, ValueQuery>;
Type:
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, TypeInfo)]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct Voter<AccountId> {
pub votes: Vec<AccountId>,
pub score: u128,
}
Without ValueQuery it does not give error, but with ValueQuery it gives error, how to fix the error. Seems I need to implement default, not sure how to do it.
the trait `std::default::Default` is not implemented for `types::Voter<<T as frame_system::Config>::AccountId>`