fn valid_attribute(
            identity: &T::AccountId, 
            name: &[u8],
            value: &[u8]
        ) -> DispatchResult { 
            ensure!(name.len() <= 64, Error::<T>::InvalidAttribute);
            let result = Self::attribute_and_id(identity, name);
            
            let (attribute, _) = match result { 
                Some((attribute, id)) => (attribute, id),
                None => { 
                    return Err(Error::<T>::InvalidAttribute.into())
                }
            };
            let now = frame_system::Pallet::<T>::block_number();
            if (attribute.validity > now) && (attribute.value == value.to_vec()) { 
                Ok(())
            } else { 
                return Err(Error::<T>::InvalidAttribute.into())
            }
        }
//  Validatres if an attribute belongs to an identity and it has not expired 
Validatres if an attribute belongs to an identity and it has not expired
Validatres if an attribute belongs to an identity and it has not expired
fn valid_attribute(
            identity: &T::AccountId, 
            name: &[u8],
            value: &[u8]
        ) -> DispatchResult { 
            ensure!(name.len() <= 64, Error::<T>::InvalidAttribute);
            let result = Self::attribute_and_id(identity, name);
            let (attribute, _) = match result { 
                Some((attribute, id)) => (attribute, id),
                None => { 
                    return Err(Error::<T>::InvalidAttribute.into())
                }
            };
            let now = frame_system::Pallet::<T>::block_number();
            if (attribute.validity > now) && (attribute.value == value.to_vec()) { 
                Ok(())
            } else { 
                return Err(Error::<T>::InvalidAttribute.into())
            }
        }
fn valid_attribute ( identity : & T :: AccountId , name : & [ u8 ] , value : & [ u8 ] ) -> DispatchResult { ensure ! ( name len ( ) 64 Error T InvalidAttribute ) ; let result = Self :: attribute_and_id ( identity , name ) ; let ( attribute , _ ) = match result { Some ( ( attribute , id ) ) => ( attribute , id ) , None => { return Err ( Error :: < T > :: InvalidAttribute . into ( ) ) } } ; let now = frame_system :: Pallet :: < T > :: block_number ( ) ; if ( attribute . validity > now ) && ( attribute . value == value . to_vec ( ) ) { Ok ( ( ) ) } else { return Err ( Error :: < T > :: InvalidAttribute . into ( ) ) } }
Validatres if an attribute belongs to an identity and it has not expired
Validatres if an attribute belongs to an identity and it has not expired
identity
&T::AccountId
name
&[u8]
value
&[u8]
identity
&T::AccountId
name
&[u8]
value
&[u8]