Skip to content
Snippets Groups Projects
Commit 961e69c3 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

fix(#125): feat(identity): associate idty_index to uid

parent d65e46fd
No related branches found
No related tags found
No related merge requests found
...@@ -171,7 +171,7 @@ pub mod pallet { ...@@ -171,7 +171,7 @@ pub mod pallet {
) )
} }
<Identities<T>>::insert(idty_index, idty.value.clone()); <Identities<T>>::insert(idty_index, idty.value.clone());
IdentitiesNames::<T>::insert(idty.name.clone(), ()); IdentitiesNames::<T>::insert(idty.name.clone(), idty_index);
IdentityIndexOf::<T>::insert(idty.value.owner_key, idty_index); IdentityIndexOf::<T>::insert(idty.value.owner_key, idty_index);
} }
} }
...@@ -200,7 +200,7 @@ pub mod pallet { ...@@ -200,7 +200,7 @@ pub mod pallet {
#[pallet::storage] #[pallet::storage]
#[pallet::getter(fn identity_by_did)] #[pallet::getter(fn identity_by_did)]
pub type IdentitiesNames<T: Config> = pub type IdentitiesNames<T: Config> =
StorageMap<_, Blake2_128Concat, IdtyName, (), OptionQuery>; StorageMap<_, Blake2_128Concat, IdtyName, T::IdtyIndex, OptionQuery>;
/// counter of the identity index to give to the next identity /// counter of the identity index to give to the next identity
#[pallet::storage] #[pallet::storage]
...@@ -365,7 +365,7 @@ pub mod pallet { ...@@ -365,7 +365,7 @@ pub mod pallet {
idty_value.status = IdtyStatus::ConfirmedByOwner; idty_value.status = IdtyStatus::ConfirmedByOwner;
<Identities<T>>::insert(idty_index, idty_value); <Identities<T>>::insert(idty_index, idty_value);
<IdentitiesNames<T>>::insert(idty_name.clone(), ()); <IdentitiesNames<T>>::insert(idty_name.clone(), idty_index);
Self::deposit_event(Event::IdtyConfirmed { Self::deposit_event(Event::IdtyConfirmed {
idty_index, idty_index,
owner_key: who, owner_key: who,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment