Skip to content

Commit

Permalink
refactor: extracted common TokenPrice definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Iago Lluque committed Sep 26, 2023
1 parent ff1ba35 commit 176e702
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/bin/zksync_api/src/fee_ticker/ticker_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,21 @@ impl FeeTickerInfo for TickerInfo {
}
};

let price_1_usd = TokenPrice {
usd_price: Ratio::from_integer(1u32.into()),
last_updated: Utc::now(),
};

// TODO: remove hardcode for RDOC token
if token.symbol == "RDOC" {
metrics::histogram!(TICKET_INFO_GET_LAST_TOKEN_PRICE, start.elapsed(), "type" => "RDOC");
return Ok(TokenPrice {
usd_price: Ratio::from_integer(1u32.into()),
last_updated: Utc::now(),
});
return Ok(price_1_usd);
}

// TODO: remove hardcode for USDRIF token
if token.symbol == "USDRIF" {
metrics::histogram!(TICKET_INFO_GET_LAST_TOKEN_PRICE, start.elapsed(), "type" => "USDRIF");
return Ok(TokenPrice {
usd_price: Ratio::from_integer(1u32.into()),
last_updated: Utc::now(),
});
return Ok(price_1_usd);
}

let historical_price = self
Expand Down

0 comments on commit 176e702

Please sign in to comment.