pub fn extract_registry_address_from_deposit(
        &self,
        registry_id: u32,
        code_hash: &Byte32,
        args: &[u8],
    ) -> Result<RegistryAddress, Error> {
        // We only support ETH registry in current stage
        if registry_id != ETH_REGISTRY_ACCOUNT_ID {
            return Err(Error::InvalidArgs);
        }
        // Check EOA code hash
        match self
            .find_eoa_type_by_hash(code_hash)
            .map(|type_hash| {
                let type_: u8 = type_hash.type_().into();
                type_.try_into()
            })
            .transpose()
            .map_err(|_err| Error::UnknownEoaCodeHash)?
        {
            Some(AllowedEoaType::Eth) => {
                // extract ETH EOA
                let address =
                    { crate::registry::eth_registry::extract_eth_address_from_eoa(args)? };
                let addr = RegistryAddress::new(registry_id, address);
                Ok(addr)
            }
            _ => Err(Error::UnknownEoaCodeHash),
        }
    }
/// Extract EOA registry address from deposit request
// TODO support extract ETH address from tron EOA
Extract EOA registry address from deposit request
TODO support extract ETH address from tron EOA
Extract EOA registry address from deposit request TODO support extract ETH address from tron EOA
pub fn extract_registry_address_from_deposit(
        &self,
        registry_id: u32,
        code_hash: &Byte32,
        args: &[u8],
    ) -> Result<RegistryAddress, Error> {
        // We only support ETH registry in current stage
        if registry_id != ETH_REGISTRY_ACCOUNT_ID {
            return Err(Error::InvalidArgs);
        }
        // Check EOA code hash
        match self
            .find_eoa_type_by_hash(code_hash)
            .map(|type_hash| {
                let type_: u8 = type_hash.type_().into();
                type_.try_into()
            })
            .transpose()
            .map_err(|_err| Error::UnknownEoaCodeHash)?
        {
            Some(AllowedEoaType::Eth) => {
                // extract ETH EOA
                let address =
                    { crate::registry::eth_registry::extract_eth_address_from_eoa(args)? };
                let addr = RegistryAddress::new(registry_id, address);
                Ok(addr)
            }
            _ => Err(Error::UnknownEoaCodeHash),
        }
    }
pub fn extract_registry_address_from_deposit ( & self , registry_id : u32 , code_hash : & Byte32 , args : & [ u8 ] , ) -> Result < RegistryAddress , Error > { // We only support ETH registry in current stage if registry_id != ETH_REGISTRY_ACCOUNT_ID { return Err ( Error :: InvalidArgs ) ; } // Check EOA code hash match self . find_eoa_type_by_hash ( code_hash ) . map ( | type_hash | { let type_ : u8 = type_hash . type_ ( ) . into ( ) ; type_ . try_into ( ) } ) . transpose ( ) . map_err ( | _err | Error :: UnknownEoaCodeHash ) ? { Some ( AllowedEoaType :: Eth ) => { // extract ETH EOA let address = { crate :: registry :: eth_registry :: extract_eth_address_from_eoa ( args ) ? } ; let addr = RegistryAddress :: new ( registry_id , address ) ; Ok ( addr ) } _ => Err ( Error :: UnknownEoaCodeHash ) , } }
Extract EOA registry address from deposit request
TODO support extract ETH address from tron EOA
Extract EOA registry address from deposit request TODO support extract ETH address from tron EOA
&self
registry_id
u32
code_hash
&Byte32
args
&[u8]
&self
registry_id
u32
code_hash
&Byte32
args
&[u8]