From a029390c38cc1a9df4d006ce365491f449937f0f Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Mon, 11 Jan 2021 11:16:39 +0000 Subject: [PATCH] dispatcher getters --- rustybot/Cargo.lock | 53 ++++++++++++++++++++++++++++++++++++++++++- rustybot/src/pairs.rs | 7 ++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/rustybot/Cargo.lock b/rustybot/Cargo.lock index c51ed09..0b385b8 100644 --- a/rustybot/Cargo.lock +++ b/rustybot/Cargo.lock @@ -77,6 +77,8 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" name = "bitfinex" version = "0.4.3" dependencies = [ + "bitflags", + "chrono", "error-chain", "hex", "log 0.3.9", @@ -183,6 +185,19 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "time", + "winapi 0.3.9", +] + [[package]] name = "core-foundation" version = "0.9.1" @@ -372,7 +387,7 @@ checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" dependencies = [ "cfg-if 0.1.10", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] @@ -765,6 +780,25 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + [[package]] name = "num_cpus" version = "1.13.0" @@ -1239,6 +1273,17 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] + [[package]] name = "tinyvec" version = "1.1.0" @@ -1513,6 +1558,12 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasm-bindgen" version = "0.2.69" diff --git a/rustybot/src/pairs.rs b/rustybot/src/pairs.rs index e5f779e..aa0fb46 100644 --- a/rustybot/src/pairs.rs +++ b/rustybot/src/pairs.rs @@ -33,6 +33,13 @@ impl<'a> PairStatus<'a> { } } + pub fn dispatcher(&self) -> &EventDispatcher { + &self.dispatcher + } + pub fn dispatcher_mut(&mut self) -> &mut EventDispatcher { + &mut self.dispatcher + } + pub fn add_position(&mut self, position: Position) { let (new_position, events, signals) = { match &self.strategy {