Rename StorageMap::exists to ::contains_key (Resolves #4839) (#4847)

* rename StorageMap::exists(key) to ::contains_key(key)

* bump impl_version
This commit is contained in:
Alexander Popiak
2020-02-08 20:31:35 +01:00
committed by GitHub
parent 503bfc9da9
commit cb567d6b8b
26 changed files with 100 additions and 100 deletions
+2 -2
View File
@@ -525,7 +525,7 @@ decl_module! {
let who = ensure_signed(origin)?;
ensure!(!Self::presentation_active(), Error::<T>::CannotRetractPresenting);
ensure!(<VoterInfoOf<T>>::exists(&who), Error::<T>::RetractNonVoter);
ensure!(<VoterInfoOf<T>>::contains_key(&who), Error::<T>::RetractNonVoter);
let index = index as usize;
let voter = Self::voter_at(index).ok_or(Error::<T>::InvalidRetractionIndex)?;
ensure!(voter == who, Error::<T>::InvalidRetractionIndex);
@@ -730,7 +730,7 @@ impl<T: Trait> Module<T> {
/// If `who` a candidate at the moment?
pub fn is_a_candidate(who: &T::AccountId) -> bool {
<RegisterInfoOf<T>>::exists(who)
<RegisterInfoOf<T>>::contains_key(who)
}
/// Iff the member `who` still has a seat at blocknumber `n` returns `true`.