Implement iter for doublemap (#5504)

* implement iter for doublemap

* fmt

* fix tests

* fix staking mock

* address comment

* update doc and constraint for reversible hasher

Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
thiolliere
2020-04-15 16:49:08 +02:00
committed by GitHub
parent 24fc051c86
commit 28edcbfe8d
7 changed files with 187 additions and 67 deletions
+1 -1
View File
@@ -626,7 +626,7 @@ decl_module! {
fn remove_recovery(origin) {
let who = ensure_signed(origin)?;
// Check there are no active recoveries
let mut active_recoveries = <ActiveRecoveries<T>>::iter_prefix(&who);
let mut active_recoveries = <ActiveRecoveries<T>>::iter_prefix_values(&who);
ensure!(active_recoveries.next().is_none(), Error::<T>::StillActive);
// Take the recovery configuration for this account.
let recovery_config = <Recoverable<T>>::take(&who).ok_or(Error::<T>::NotRecoverable)?;