Skip to content

Commit

Permalink
update get_price api
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Dec 19, 2024
1 parent 82d7bb6 commit d5ded95
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/ain-ocean/src/api/prices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,12 @@ async fn get_price(
) -> Result<Response<Option<PriceTickerResponse>>> {
let (token, currency) = parse_token_currency(&key)?;

let price_repo = &ctx.services.price_ticker;
let sort_key = price_repo.by_key.get(&(token.clone(), currency.clone()))?;
let Some(sort_key) = sort_key else {
return Ok(Response::new(None));
};
let price_ticker = ctx
.services
.price_ticker
.by_id
.get(&sort_key)?;
let price_ticker = price_repo.by_id.get(&sort_key)?;

let Some((_, price_ticker)) = price_ticker else {
return Ok(Response::new(None));
Expand Down

0 comments on commit d5ded95

Please sign in to comment.