Skip to content

Commit e62efb9

Browse files
committed
fix: base/quote order
1 parent f718465 commit e62efb9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pragma-node/src/handlers/entries/get_entry.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use super::GetEntryParams;
1818
(status = 200, description = "Get median entry successfuly", body = [GetEntryResponse])
1919
),
2020
params(
21-
("quote" = String, Path, description = "Quote Asset"),
2221
("base" = String, Path, description = "Base Asset"),
22+
("quote" = String, Path, description = "Quote Asset"),
2323
GetEntryParams,
2424
),
2525
)]
@@ -30,7 +30,7 @@ pub async fn get_entry(
3030
) -> Result<Json<GetEntryResponse>, EntryError> {
3131
tracing::info!("Received get entry request for pair {:?}", pair);
3232
// Construct pair id
33-
let pair_id = currency_pair_to_pair_id(&pair.1, &pair.0);
33+
let pair_id = currency_pair_to_pair_id(&pair.0, &pair.1);
3434

3535
let now = chrono::Utc::now().naive_utc().timestamp_millis() as u64;
3636

pragma-node/src/handlers/entries/get_ohlc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use super::GetEntryParams;
1717
(status = 200, description = "Get OHLC data successfuly", body = [GetOHLCResponse])
1818
),
1919
params(
20-
("quote" = String, Path, description = "Quote Asset"),
2120
("base" = String, Path, description = "Base Asset"),
21+
("quote" = String, Path, description = "Quote Asset"),
2222
GetEntryParams,
2323
),
2424
)]
@@ -29,7 +29,7 @@ pub async fn get_ohlc(
2929
) -> Result<Json<GetOHLCResponse>, EntryError> {
3030
tracing::info!("Received get entry request for pair {:?}", pair);
3131
// Construct pair id
32-
let pair_id = currency_pair_to_pair_id(&pair.1, &pair.0);
32+
let pair_id = currency_pair_to_pair_id(&pair.0, &pair.1);
3333

3434
let now = chrono::Utc::now().naive_utc().timestamp_millis() as u64;
3535

pragma-node/src/handlers/entries/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use crate::infra::repositories::entry_repository::MedianEntry;
66
/// Converts a currency pair to a pair id.
77
///
88
/// e.g "btc" and "usd" to "BTC/USD"
9-
pub(crate) fn currency_pair_to_pair_id(quote: &str, base: &str) -> String {
10-
format!("{}/{}", quote.to_uppercase(), base.to_uppercase())
9+
pub(crate) fn currency_pair_to_pair_id(base: &str, quote: &str) -> String {
10+
format!("{}/{}", base.to_uppercase(), quote.to_uppercase())
1111
}
1212

1313
/// Computes the median price and time from a list of entries.

0 commit comments

Comments
 (0)