pub fn new_address(&mut self) -> Result<(AuthenticationKey, ChildNumber)> {
        let child = self.key_factory.private_child(self.key_leaf)?;
        let authentication_key = child.get_authentication_key();
        let old_key_leaf = self.key_leaf;
        self.key_leaf.increment();
        if self
            .addr_map
            .insert(authentication_key.derived_address(), old_key_leaf)
            .is_none()
        {
            Ok((authentication_key, old_key_leaf))
        } else {
            Err(WalletError::LibraWalletGeneric(
                "This address is already in your wallet".to_string(),
            )
            .into())
        }
    }
/// Function that generates a new key and adds it to the addr_map and subsequently returns the
/// AuthenticationKey associated to the PrivateKey, along with it's ChildNumber
Function that generates a new key and adds it to the addr_map and subsequently returns the
AuthenticationKey associated to the PrivateKey, along with it's ChildNumber
Function that generates a new key and adds it to the addr_map and subsequently returns the AuthenticationKey associated to the PrivateKey along with it ' s ChildNumber
pub fn new_address(&mut self) -> Result<(AuthenticationKey, ChildNumber)> {
        let child = self.key_factory.private_child(self.key_leaf)?;
        let authentication_key = child.get_authentication_key();
        let old_key_leaf = self.key_leaf;
        self.key_leaf.increment();
        if self
            .addr_map
            .insert(authentication_key.derived_address(), old_key_leaf)
            .is_none()
        {
            Ok((authentication_key, old_key_leaf))
        } else {
            Err(WalletError::LibraWalletGeneric(
                "This address is already in your wallet".to_string(),
            )
            .into())
        }
    }
pub fn new_address ( & mut self ) -> Result < ( AuthenticationKey , ChildNumber ) > { let child = self . key_factory . private_child ( self . key_leaf ) ? ; let authentication_key = child . get_authentication_key ( ) ; let old_key_leaf = self . key_leaf ; self . key_leaf . increment ( ) ; if self . addr_map . insert ( authentication_key . derived_address ( ) , old_key_leaf ) . is_none ( ) { Ok ( ( authentication_key , old_key_leaf ) ) } else { Err ( WalletError :: LibraWalletGeneric ( " " . to_string ( ) , ) . into ( ) ) } }
Function that generates a new key and adds it to the addr_map and subsequently returns the
AuthenticationKey associated to the PrivateKey, along with it's ChildNumber
Function that generates a new key and adds it to the addr_map and subsequently returns the AuthenticationKey associated to the PrivateKey along with it ' s ChildNumber
&mut self
&mut self