Skip to content

Commit

Permalink
add manually dump command
Browse files Browse the repository at this point in the history
  • Loading branch information
kb1ns committed Dec 14, 2023
1 parent 40ba423 commit adaa582
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.6.2

- manually dump so we could migrate the snapshot to v0.7.x

# v0.6.1

- enable amm
Expand Down
4 changes: 4 additions & 0 deletions engine/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ fn do_event(
}
Ok(())
}
Event::Dump(id, time) => {
snapshot::dump(id, time, data);
Ok(())
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions engine/src/input/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ impl TryInto<Event> for Sequence {
},
self.timestamp,
)),
DUMP => Ok(Event::Dump(self.id, self.timestamp)),
// CANCEL_ALL => Ok(Event::CancelAll(
// self.id,
// self.cmd.symbol().ok_or(anyhow!(""))?,
Expand Down Expand Up @@ -345,6 +346,7 @@ pub enum Event {
TransferIn(EventId, AssetsCmd, Timestamp),
UpdateSymbol(EventId, SymbolCmd, Timestamp),
CancelAll(EventId, Symbol, Timestamp),
Dump(EventId, Timestamp),
}

impl Event {
Expand All @@ -364,6 +366,7 @@ impl Event {
Event::TransferIn(id, _, _) => *id,
Event::UpdateSymbol(id, _, _) => *id,
Event::CancelAll(id, _, _) => *id,
Event::Dump(id, _) => *id,
}
}
}
Expand Down

0 comments on commit adaa582

Please sign in to comment.