New substrate version requires derive MaxEncodedLen
I have a following storage:
#[derive(PartialEq, Eq, PartialOrd, Ord, Default, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct SortitionSumTree<AccountId> {
pub k: u64,
pub stack: Vec<u64>,
pub nodes: Vec<u64>,
pub ids_to_node_indexes: BTreeMap<AccountId, u64>, // citizen id, node index
pub node_indexes_to_ids: BTreeMap<u64, AccountId>, // node index, citizen id
}
But it gives error:
no function or associated item named `max_encoded_len` found for struct `std::vec::Vec<u64>` in the current scope
no function or associated item named `max_encoded_len` found for struct `std::collections::BTreeMap` in the current scope