//  Updates the attribute validity to make it expire and invalid 
Updates the attribute validity to make it expire and invalid
Updates the attribute validity to make it expire and invalid
fn reset_attribute(
            owner: T::AccountId, 
            identity: &T::AccountId,
            name: &[u8]
        ) -> DispatchResult {
            Self::is_owner(identity, &owner)?;
            let result = Self::attribute_and_id(identity, name);
            let now = frame_system::Pallet::<T>::block_number();
            match result {
                Some((mut attribute, id)) => {
                    attribute.validity = now;
                    <AttributeOf<T>>::mutate((&identity, id), |a| *a = attribute);
                }
                None => return Err(Error::<T>::AttributeResetFailed.into()),
            }
            UpdatedBy::<T>::insert(
                identity,
                (owner, now, T::Time::now())
            );
            Ok(())
        }
fn reset_attribute ( owner : T :: AccountId , identity : & T :: AccountId , name : & [ u8 ] ) -> DispatchResult { Self :: is_owner ( identity , & owner ) ? ; let result = Self :: attribute_and_id ( identity , name ) ; let now = frame_system :: Pallet :: < T > :: block_number ( ) ; match result { Some ( ( mut attribute , id ) ) => { attribute . validity = now ; < AttributeOf < T > > :: mutate ( ( & identity , id ) , | a | * a = attribute ) ; } None => return Err ( Error :: < T > :: AttributeResetFailed . into ( ) ) , } UpdatedBy :: < T > :: insert ( identity , ( owner , now , T :: Time :: now ( ) ) ) ; Ok ( ( ) ) }
Updates the attribute validity to make it expire and invalid
Updates the attribute validity to make it expire and invalid
owner
T::AccountId
identity
&T::AccountId
name
&[u8]