Skip to content

Commit

Permalink
chore(deps): partially replace deprecated wasm-timer with instant
Browse files Browse the repository at this point in the history
… v0.1.12 (#1836)

This partially excludes the deprecated dependency `wasm-timer` from mm2 tree. `wasm-timer` is still used but only in the p2p stack from libp2p which will also be removed with #1756
  • Loading branch information
onur-ozkan authored May 24, 2023
1 parent 4971369 commit b2daae8
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## v1.0.5-beta - ${release-date}

**Features:**

**Enhancements/Fixes:**
- Remove deprecated dependency `wasm-timer` from mm2 tree [#1836](https://github.com/KomodoPlatform/atomicDEX-API/pull/1836)

## v1.0.4-beta - 2023-05-23

**Features:**
Expand Down
5 changes: 1 addition & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mm2src/coins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ winapi = "0.3"

[dev-dependencies]
mm2_test_helpers = { path = "../mm2_test_helpers" }
wasm-timer = "0.2.4"

[build-dependencies]
prost-build = { version = "0.10.4", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/lp_price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ mod tests {
#[test]
fn test_get_cex_rates() {
use mm2_number::MmNumber;
use wasm_timer::SystemTime;
use std::time::SystemTime;

use crate::lp_price::{Provider, TickerInfos, TickerInfosRegistry};

Expand Down
3 changes: 2 additions & 1 deletion mm2src/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ ser_error_derive = { path = "../derives/ser_error_derive" }
sha2 = "0.9"
shared_ref_counter = { path = "shared_ref_counter", optional = true }
uuid = { version = "1.2.2", features = ["fast-rng", "serde", "v4"] }
wasm-timer = "0.2.4"
instant = { version = "0.1.12" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
chrono = { version = "0.4", features = ["wasmbind"] }
getrandom = { version = "0.2", features = ["js"] } # see https://docs.rs/getrandom/0.2.0/getrandom/#webassembly-support
gstuff = { version = "0.7", features = ["nightly"] }
instant = { version = "0.1.12", features = ["wasm-bindgen"] }
js-sys = "0.3.27"
serde_repr = "0.1.6"
serde-wasm-bindgen = "0.4.3"
Expand Down
2 changes: 1 addition & 1 deletion mm2src/common/time_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
//! This implements a time-based LRU cache for checking gossipsub message duplicates.

use fnv::FnvHashMap;
use instant::Instant;
use std::collections::hash_map::{self,
Entry::{Occupied, Vacant},
Iter, Keys};
use std::collections::VecDeque;
use std::time::Duration;
use wasm_timer::Instant;

#[derive(Debug)]
pub struct ExpiringElement<Element> {
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ sp-trie = { version = "6.0", default-features = false }
trie-db = { version = "0.23.1", default-features = false }
trie-root = "0.16.0"
uuid = { version = "1.2.2", features = ["fast-rng", "serde", "v4"] }
wasm-timer = "0.2.4"
instant = { version = "0.1.12" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
instant = { version = "0.1.12", features = ["wasm-bindgen"] }
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use common::executor::SpawnFuture;
use common::{log, Future01CompatExt};
use derive_more::Display;
use futures::{channel::oneshot, StreamExt};
use instant::Instant;
use keys::KeyPair;
use mm2_core::mm_ctx::{MmArc, MmWeak};
use mm2_err_handle::prelude::*;
Expand All @@ -37,7 +38,6 @@ use parking_lot::Mutex as PaMutex;
use serde::de;
use std::net::ToSocketAddrs;
use std::sync::Arc;
use wasm_timer::Instant;

use crate::mm2::lp_ordermatch;
use crate::mm2::{lp_stats, lp_swap};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![allow(dead_code)]
use instant::Instant;
use std::{collections::hash_map::{HashMap, RawEntryMut},
num::NonZeroUsize,
time::Duration};
use wasm_timer::Instant;

const ONE_SECOND: Duration = Duration::from_secs(1);

Expand Down
1 change: 0 additions & 1 deletion mm2src/mm2_metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ mm2_err_handle = { path = "../mm2_err_handle" }
serde = "1"
serde_derive = "1"
serde_json = { version = "1", features = ["preserve_order", "raw_value"] }
wasm-timer = "0.2.4"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
hyper = { version = "0.14.11", features = ["client", "http2", "server", "tcp"] }
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_metrics/src/mm_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ mod test {
use common::{block_on,
executor::{abortable_queue::AbortableQueue, Timer},
log::{LogArc, LogState}};
use wasm_timer::Instant;
use std::time::Instant;

#[test]
fn test_collect_json() {
Expand Down

0 comments on commit b2daae8

Please sign in to comment.