From 3c28bdf06813c1c2e3ad50fa72ada0e5fc740080 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89lo=C3=AFs?= <c@elo.tf>
Date: Fri, 17 Jun 2022 22:21:36 +0200
Subject: [PATCH] =?UTF-8?q?feat(identity):=C2=A0remove=20useless=20error?=
 =?UTF-8?q?=20`OwnerAccountNotExist`=20(!78)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* remove useless error `OwnerAccountNotExist`
---
 pallets/identity/src/lib.rs | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/pallets/identity/src/lib.rs b/pallets/identity/src/lib.rs
index 79fedb652..79c16b06e 100644
--- a/pallets/identity/src/lib.rs
+++ b/pallets/identity/src/lib.rs
@@ -247,11 +247,6 @@ pub mod pallet {
             let creator_idty_val =
                 Identities::<T>::try_get(&creator).map_err(|_| Error::<T>::IdtyNotFound)?;
 
-            ensure!(
-                frame_system::Pallet::<T>::account_exists(&owner_key),
-                Error::<T>::OwnerAccountNotExist
-            );
-
             if IdentityIndexOf::<T>::contains_key(&owner_key) {
                 return Err(Error::<T>::IdtyAlreadyCreated.into());
             }
@@ -502,8 +497,9 @@ pub mod pallet {
         RightNotExist,
         /// Identity creation period is not respected
         NotRespectIdtyCreationPeriod,
-        /// Owner account does not exist
-        OwnerAccountNotExist,
+        // Removed error: OwnerAccountNotExist,
+        // Caution: if you add a new error, you should explicitly set the index
+        // to not reuse the same index as the removed error.
     }
 
     // PUBLIC FUNCTIONS //
-- 
GitLab