pub fn try_register<'b>(
        &mut self,
        storage: &'b mut dyn Storage,
        name: &String,
        owner: &Addr,
    ) -> Result<()> {
        match self.name_is_registered(storage, &name) {
            true => Err(anyhow!("Name already registered: {}.{}", name, self.tld)),
            false => Ok(()),
        }?;

        self.try_save_record(
            storage,
            name,
            &NameRecord {
                owner: owner.clone(),
                value: None,
                lineage: None,
            },
        )?;

        Ok(())
    }
/// Attempt to register a name to a given owner
/// An Err will be returned if the name is already registered
Attempt to register a name to a given owner
An Err will be returned if the name is already registered
Attempt to register a name to a given owner An Err will be returned if the name is already registered
pub fn try_register<'b>(
        &mut self,
        storage: &'b mut dyn Storage,
        name: &String,
        owner: &Addr,
    ) -> Result<()> {
        match self.name_is_registered(storage, &name) {
            true => Err(anyhow!("Name already registered: {}.{}", name, self.tld)),
            false => Ok(()),
        }?;
        self.try_save_record(
            storage,
            name,
            &NameRecord {
                owner: owner.clone(),
                value: None,
                lineage: None,
            },
        )?;
        Ok(())
    }
pub fn try_register < ' b > ( & mut self , storage : & ' b mut dyn Storage , name : & String , owner : & Addr , ) -> Result < ( ) > { match self . name_is_registered ( storage , & name ) { true => Err ( anyhow ! ( " " name self tld ) ) , false => Ok ( ( ) ) , } ? ; self . try_save_record ( storage , name , & NameRecord { owner : owner . clone ( ) , value : None , lineage : None , } , ) ? ; Ok ( ( ) ) }
Attempt to register a name to a given owner
An Err will be returned if the name is already registered
Attempt to register a name to a given owner An Err will be returned if the name is already registered
&mut self
storage
&'b mut dyn Storage
name
&String
owner
&Addr
&mut self
storage
&'b mut dyn Storage
name
&String
owner
&Addr