Skip to content

Commit

Permalink
Filled gate prev_seq_id
Browse files Browse the repository at this point in the history
  • Loading branch information
soulmachine committed Jan 19, 2022
1 parent 6118bea commit cf9ae4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crypto-msg-parser/src/exchanges/gate/gate_spot_current.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn parse_l2_update(msg: &str) -> Result<Vec<OrderBookMsg>, SimpleError> {
msg_type: MessageType::L2Event,
timestamp: result.t,
seq_id: Some(result.u as u64),
prev_seq_id: None,
prev_seq_id: Some(result.U as u64 - 1),
asks: if let Some(asks) = result.a {
asks.iter().map(parse_order).collect()
} else {
Expand Down
5 changes: 4 additions & 1 deletion crypto-msg-parser/src/exchanges/gate/gate_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,10 @@ fn parse_l2_update(market_type: MarketType, msg: &str) -> Result<Vec<OrderBookMs
msg_type: MessageType::L2Event,
timestamp: result.t,
seq_id: result.extra.get("u").and_then(|v| v.as_u64()),
prev_seq_id: None,
prev_seq_id: result
.extra
.get("U")
.and_then(|v| v.as_u64().map(|v| v - 1)),
asks: result
.a
.iter()
Expand Down

0 comments on commit cf9ae4e

Please sign in to comment.