pub fn find_pools_with_lp(&self, lp_token_name: &str) -> Result<Vec<Pool>, FarmClientError> {
        let (protocol, token_a, token_b) = FarmClient::extract_token_names(lp_token_name)?;
        let pools = self.find_pools(&protocol, &token_a, &token_b)?;
        let mut res = vec![];
        for pool in pools {
            if let Some(lp_token) = self.get_token_by_ref_from_cache(&pool.lp_token_ref)? {
                if lp_token.name.as_str() == lp_token_name {
                    res.push(pool);
                }
            }
        }

        if res.is_empty() {
            Err(FarmClientError::RecordNotFound(format!(
                "{} Pool with LP token {}",
                protocol, lp_token_name
            )))
        } else {
            res.sort_by(|a, b| b.version.cmp(&a.version));
            Ok(res)
        }
    }
/// Returns all Pools sorted by version for the given LP token
Returns all Pools sorted by version for the given LP token
Returns all Pools sorted by version for the given LP token
pub fn find_pools_with_lp(&self, lp_token_name: &str) -> Result<Vec<Pool>, FarmClientError> {
        let (protocol, token_a, token_b) = FarmClient::extract_token_names(lp_token_name)?;
        let pools = self.find_pools(&protocol, &token_a, &token_b)?;
        let mut res = vec![];
        for pool in pools {
            if let Some(lp_token) = self.get_token_by_ref_from_cache(&pool.lp_token_ref)? {
                if lp_token.name.as_str() == lp_token_name {
                    res.push(pool);
                }
            }
        }
        if res.is_empty() {
            Err(FarmClientError::RecordNotFound(format!(
                "{} Pool with LP token {}",
                protocol, lp_token_name
            )))
        } else {
            res.sort_by(|a, b| b.version.cmp(&a.version));
            Ok(res)
        }
    }
pub fn find_pools_with_lp ( & self , lp_token_name : & str ) -> Result < Vec < Pool > , FarmClientError > { let ( protocol , token_a , token_b ) = FarmClient :: extract_token_names ( lp_token_name ) ? ; let pools = self . find_pools ( & protocol , & token_a , & token_b ) ? ; let mut res = vec ! [ ] ; for pool in pools { if let Some ( lp_token ) = self . get_token_by_ref_from_cache ( & pool . lp_token_ref ) ? { if lp_token . name . as_str ( ) == lp_token_name { res . push ( pool ) ; } } } if res . is_empty ( ) { Err ( FarmClientError :: RecordNotFound ( format ! ( " " protocol lp_token_name ) ) ) } else { res . sort_by ( | a , b | b . version . cmp ( & a . version ) ) ; Ok ( res ) } }
Returns all Pools sorted by version for the given LP token
Returns all Pools sorted by version for the given LP token
&self
lp_token_name
&str
&self
lp_token_name
&str