fix(data): add missing 3d and 1M Binance kline intervals (#312)
Binance supports 16 kline intervals (1s,1m,3m,5m,15m,30m,1h,2h,4h,6h,8h, 12h,1d,3d,1w,1M); the live-binance `Interval` enum listed only 14, missing three-day (`3d`) and one-month (`1M`). Add both variants in Binance order with their wire-format strings, and extend the exhaustive as_str test.
This commit is contained in:
@@ -92,7 +92,9 @@ pub enum Interval {
|
||||
EightHours,
|
||||
TwelveHours,
|
||||
OneDay,
|
||||
ThreeDays,
|
||||
OneWeek,
|
||||
OneMonth,
|
||||
}
|
||||
|
||||
impl Interval {
|
||||
@@ -112,7 +114,9 @@ impl Interval {
|
||||
Self::EightHours => "8h",
|
||||
Self::TwelveHours => "12h",
|
||||
Self::OneDay => "1d",
|
||||
Self::ThreeDays => "3d",
|
||||
Self::OneWeek => "1w",
|
||||
Self::OneMonth => "1M",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -413,7 +417,9 @@ mod tests {
|
||||
(Interval::EightHours, "8h"),
|
||||
(Interval::TwelveHours, "12h"),
|
||||
(Interval::OneDay, "1d"),
|
||||
(Interval::ThreeDays, "3d"),
|
||||
(Interval::OneWeek, "1w"),
|
||||
(Interval::OneMonth, "1M"),
|
||||
];
|
||||
for (iv, expected) in pairs {
|
||||
assert_eq!(iv.as_str(), *expected);
|
||||
|
||||
Reference in New Issue
Block a user