Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions mm2src/coins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ cfg-if = "1.0"
chain = { path = "../mm2_bitcoin/chain" }
chrono = { version = "0.4.23", "features" = ["serde"] }
common = { path = "../common" }
compatible-time = { version = "1.1.0", package = "web-time" }
cosmrs = { version = "0.16", default-features = false }
crossbeam = "0.8"
crypto = { path = "../crypto" }
Expand Down Expand Up @@ -118,7 +119,6 @@ zcash_primitives = {features = ["transparent-inputs"], git = "https://github.co
blake2b_simd = "0.5"
ff = "0.8"
futures-util = "0.3"
instant = "0.1.12"
jubjub = "0.5.1"
js-sys = { version = "0.3.27" }
mm2_db = { path = "../mm2_db" }
Expand All @@ -141,7 +141,6 @@ hyper = { version = "0.14.26", features = ["client", "http2", "server", "tcp"] }
# using webpki-tokio to avoid rejecting valid certificates
# got "invalid certificate: UnknownIssuer" for https://ropsten.infura.io on iOS using default-features
hyper-rustls = { version = "0.24", default-features = false, features = ["http1", "http2", "webpki-tokio"] }
instant = { version = "0.1.12", features = ["wasm-bindgen"] }
lightning = "0.0.113"
lightning-background-processor = "0.0.113"
lightning-invoice = { version = "0.21.0", features = ["serde"] }
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ use crypto::{Bip44Chain, CryptoCtx, CryptoCtxError, GlobalHDAccountArc, KeyPairP
use derive_more::Display;
use enum_derives::EnumFromStringify;

use compatible_time::Instant;
use ethabi::{Contract, Function, Token};
use ethcore_transaction::tx_builders::TxBuilderError;
use ethcore_transaction::{Action, TransactionWrapper, TransactionWrapperBuilder as UnSignedEthTxBuilder,
Expand All @@ -76,7 +77,6 @@ use futures::compat::Future01CompatExt;
use futures::future::{join, join_all, select_ok, try_join_all, Either, FutureExt, TryFutureExt};
use futures01::Future;
use http::Uri;
use instant::Instant;
use mm2_core::mm_ctx::{MmArc, MmWeak};
use mm2_number::bigdecimal_custom::CheckedDivision;
use mm2_number::{BigDecimal, BigUint, MmNumber};
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/eth/eth_balance_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use mm2_event_stream::{Broadcaster, Event, EventStreamer, NoDataIn, StreamHandle
use mm2_number::BigDecimal;

use async_trait::async_trait;
use compatible_time::Instant;
use ethereum_types::Address;
use futures::{channel::oneshot, stream::FuturesUnordered, StreamExt};
use instant::Instant;
use serde::Deserialize;
use serde_json::Value as Json;
use std::collections::{HashMap, HashSet};
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/eth/eth_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use super::web3_transport::FeeHistoryResult;
use super::{web3_transport::Web3Transport, EthCoin};
use common::{custom_futures::timeout::FutureTimerExt, log::debug};
use instant::Duration;
use compatible_time::Duration;
use serde_json::Value;
use web3::types::{Address, Block, BlockId, BlockNumber, Bytes, CallRequest, FeeHistory, Filter, Log, Proof, SyncState,
Trace, TraceFilter, Transaction, TransactionId, TransactionReceipt, TransactionRequest, Work, H256,
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/eth/fee_estimation/eth_fee_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use common::executor::Timer;
use mm2_event_stream::{Broadcaster, Event, EventStreamer, NoDataIn, StreamHandlerInput};

use async_trait::async_trait;
use compatible_time::Instant;
use futures::channel::oneshot;
use instant::Instant;
use serde::Deserialize;
use std::convert::TryFrom;

Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/eth/v2_activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use crate::nft::nft_errors::{GetNftInfoError, ParseChainTypeError};
use crate::nft::nft_structs::Chain;
#[cfg(target_arch = "wasm32")] use crate::EthMetamaskPolicy;
use common::executor::AbortedError;
use compatible_time::Instant;
use crypto::{trezor::TrezorError, Bip32Error, CryptoCtxError, HwError};
use enum_derives::EnumFromTrait;
use instant::Instant;
use mm2_err_handle::common_errors::WithInternal;
#[cfg(target_arch = "wasm32")]
use mm2_metamask::{from_metamask_error, MetamaskError, MetamaskRpcError, WithMetamaskRpcError};
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/eth/web3_transport/websocket_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ use crate::eth::{EthCoin, RpcTransportEventHandlerShared};
use crate::{MmCoin, RpcTransportEventHandler};
use common::executor::{AbortSettings, SpawnAbortable, Timer};
use common::log;
use compatible_time::{Duration, Instant};
use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender};
use futures::channel::oneshot;
use futures::lock::Mutex as AsyncMutex;
use futures_ticker::Ticker;
use futures_util::{FutureExt, SinkExt, StreamExt};
use instant::{Duration, Instant};
use jsonrpc_core::Call;
use mm2_p2p::Keypair;
use proxy_signature::{ProxySign, RawMessage};
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/tendermint/tendermint_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use common::executor::{abortable_queue::AbortableQueue, AbortableSystem};
use common::executor::{AbortedError, Timer};
use common::log::{debug, warn};
use common::{get_utc_timestamp, now_sec, Future01CompatExt, PagingOptions, DEX_FEE_ADDR_PUBKEY};
use compatible_time::Duration;
use cosmrs::bank::MsgSend;
use cosmrs::crypto::secp256k1::SigningKey;
use cosmrs::distribution::MsgWithdrawDelegatorReward;
Expand Down Expand Up @@ -67,7 +68,6 @@ use futures::lock::Mutex as AsyncMutex;
use futures::{FutureExt, TryFutureExt};
use futures01::Future;
use hex::FromHexError;
use instant::Duration;
use itertools::Itertools;
use keys::{KeyPair, Public};
use mm2_core::mm_ctx::{MmArc, MmWeak};
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/utxo/rpc_clients/electrum_rpc/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use std::sync::atomic::{AtomicU64, Ordering as AtomicOrdering};
use std::sync::{Arc, Mutex};
use std::time::Duration;

use compatible_time::Instant;
use futures::channel::oneshot as async_oneshot;
use futures::compat::{Future01CompatExt, Stream01CompatExt};
use futures::future::FutureExt;
Expand All @@ -27,7 +28,6 @@ use futures::stream::StreamExt;
use futures01::sync::mpsc;
use futures01::{Sink, Stream};
use http::Uri;
use instant::Instant;
use serde::Serialize;

cfg_native! {
Expand Down
3 changes: 1 addition & 2 deletions mm2src/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ async-trait = "0.1"
backtrace = "0.3"
bytes = "1.1"
cfg-if = "1.0"
compatible-time = { version = "1.1.0", package = "web-time" }
crossbeam = "0.8"
env_logger = "0.9.3"
derive_more = "0.99"
Expand Down Expand Up @@ -48,11 +49,9 @@ ser_error_derive = { path = "../derives/ser_error_derive" }
sha2 = "0.10"
shared_ref_counter = { path = "shared_ref_counter", optional = true }
uuid = { version = "1.2.2", features = ["fast-rng", "serde", "v4"] }
instant = { version = "0.1.12" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
chrono = { version = "0.4", features = ["wasmbind"] }
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
3 changes: 1 addition & 2 deletions mm2src/mm2_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ async-std = { version = "1.5", features = ["unstable"] }
async-trait = "0.1"
cfg-if = "1.0"
common = { path = "../common" }
compatible-time = { version = "1.1.0", package = "web-time" }
db_common = { path = "../db_common" }
derive_more = "0.99"
futures = { version = "0.3", package = "futures", features = ["compat", "async-await", "thread-pool"] }
Expand All @@ -32,13 +33,11 @@ shared_ref_counter = { path = "../common/shared_ref_counter" }
uuid = { version = "1.2.2", features = ["fast-rng", "serde", "v4"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
instant = { version = "0.1.12", features = ["wasm-bindgen"] }
mm2_rpc = { path = "../mm2_rpc", features = [ "rpc_facilities" ] }
timed-map = { version = "1.3", features = ["rustc-hash", "wasm"] }
wasm-bindgen-test = { version = "0.3.2" }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
rustls = { version = "0.21", default-features = false }
instant = "0.1.12"
tokio = { version = "1.20", features = ["io-util", "rt-multi-thread", "net"] }
timed-map = { version = "1.3", features = ["rustc-hash"] }
4 changes: 2 additions & 2 deletions mm2src/mm2_core/src/data_asker.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use common::custom_futures::timeout::FutureTimerExt;
use common::{HttpStatusCode, StatusCode};
use compatible_time::Duration;
use derive_more::Display;
use futures::channel::oneshot;
use futures::lock::Mutex as AsyncMutex;
use instant::Duration;
use mm2_err_handle::prelude::*;
use mm2_event_stream::Event;
use ser_error_derive::SerializeErrorType;
Expand Down Expand Up @@ -142,7 +142,7 @@ mod tests {
use crate::mm_ctx::MmCtxBuilder;
use common::block_on;
use common::executor::Timer;
use instant::Duration;
use compatible_time::Duration;
use serde::Deserialize;
use serde_json::json;
use std::thread;
Expand Down
4 changes: 3 additions & 1 deletion mm2src/mm2_main/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ cfg-if = "1.0"
coins = { path = "../coins" }
coins_activation = { path = "../coins_activation" }
common = { path = "../common" }
compatible-time = { version = "1.1.0", package = "web-time" }
crc32fast = { version = "1.3.2", features = ["std", "nightly"] }
crossbeam = "0.8"
crypto = { path = "../crypto" }
Expand All @@ -55,7 +56,6 @@ hash-db = "0.15.2"
hex = "0.4.2"
http = "0.2"
hw_common = { path = "../hw_common" }
instant = { version = "0.1.12" }
itertools = "0.10"
keys = { path = "../mm2_bitcoin/keys" }
lazy_static = "1.4"
Expand Down Expand Up @@ -101,6 +101,8 @@ trie-root = "0.16.0"
uuid = { version = "1.2.2", features = ["fast-rng", "serde", "v4"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
# TODO: Removing this causes `wasm-pack` to fail when starting a web session (even though we don't use this crate).
# Investigate why.
instant = { version = "0.1.12", features = ["wasm-bindgen"] }
js-sys = { version = "0.3.27" }
mm2_db = { path = "../mm2_db" }
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_healthcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use async_std::prelude::FutureExt;
use chrono::Utc;
use common::executor::SpawnFuture;
use common::{log, HttpStatusCode, StatusCode};
use compatible_time::{Duration, Instant};
use derive_more::Display;
use futures::channel::oneshot::{self, Receiver, Sender};
use instant::{Duration, Instant};
use lazy_static::lazy_static;
use mm2_core::mm_ctx::MmArc;
use mm2_err_handle::prelude::MmError;
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,9 +23,9 @@
use coins::lp_coinfind;
use common::executor::SpawnFuture;
use common::{log, Future01CompatExt};
use compatible_time::Instant;
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 Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(dead_code)]
use instant::Instant;
use compatible_time::Instant;
use std::{collections::hash_map::{HashMap, RawEntryMut},
num::NonZeroUsize,
time::Duration};
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_swap/swap_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use coins::{CanRefundHtlc, ConfirmPaymentInput, FoundSwapTxSpend, MmCoinEnum, Re
use common::executor::{AbortSettings, SpawnAbortable, Timer};
use common::log::{debug, error, info};
use common::{now_sec, DEX_FEE_ADDR_RAW_PUBKEY};
use compatible_time::Duration;
use futures::compat::Future01CompatExt;
use instant::Duration;
use mm2_core::mm_ctx::MmArc;
use mm2_err_handle::prelude::MapToMmResult;
use mm2_libp2p::{decode_signed, pub_sub_topic, TopicPrefix};
Expand Down
3 changes: 2 additions & 1 deletion mm2src/mm2_main/tests/docker_tests/tendermint_tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use common::{block_on, log};
use instant::Duration;
use mm2_number::BigDecimal;
use mm2_rpc::data::legacy::OrderbookResponse;
use mm2_test_helpers::for_tests::{atom_testnet_conf, disable_coin, disable_coin_err, enable_tendermint,
Expand All @@ -17,6 +16,7 @@ use std::collections::HashSet;
use std::iter::FromIterator;
use std::sync::Mutex;
use std::thread;
use std::time::Duration;

const TENDERMINT_TEST_SEED: &str = "tendermint test seed";
const TENDERMINT_CONSTANT_BALANCE_SEED: &str = "tendermint constant balance seed";
Expand Down Expand Up @@ -817,6 +817,7 @@ mod swap {
use crate::integration_tests_common::enable_electrum;
use common::executor::Timer;
use common::log;
use compatible_time::Duration;
use ethereum_types::{Address, U256};
use mm2_rpc::data::legacy::OrderbookResponse;
use mm2_test_helpers::for_tests::{check_my_swap_status, check_recent_swaps, doc_conf, enable_eth_coin,
Expand Down
3 changes: 1 addition & 2 deletions mm2src/mm2_p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ doctest = false
[dependencies]
async-trait = "0.1"
common = { path = "../common" }
compatible-time = { version = "1.1.0", package = "web-time" }
derive_more = "0.99"
futures = { version = "0.3.1", default-features = false }
futures-ticker = "0.0.3"
Expand All @@ -37,14 +38,12 @@ void = "1.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
futures-rustls = "0.24"
instant = "0.1.12"
libp2p = { git = "https://github.com/KomodoPlatform/rust-libp2p.git", tag = "k-0.52.12", default-features = false, features = ["dns", "identify", "floodsub", "gossipsub", "noise", "ping", "request-response", "secp256k1", "tcp", "tokio", "websocket", "macros", "yamux"] }
timed-map = { version = "1.3", features = ["rustc-hash"] }
tokio = { version = "1.20", default-features = false }

[target.'cfg(target_arch = "wasm32")'.dependencies]
futures-rustls = "0.22"
instant = { version = "0.1.12", features = ["wasm-bindgen"] }
libp2p = { git = "https://github.com/KomodoPlatform/rust-libp2p.git", tag = "k-0.52.12", default-features = false, features = ["identify", "floodsub", "noise", "gossipsub", "ping", "request-response", "secp256k1", "wasm-ext", "wasm-ext-websocket", "macros", "yamux"] }
timed-map = { version = "1.3", features = ["rustc-hash", "wasm"] }

Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_p2p/src/behaviours/atomicdex.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use common::executor::SpawnFuture;
use compatible_time::Duration;
use derive_more::Display;
use futures::channel::mpsc::{channel, Receiver, Sender};
use futures::{channel::oneshot,
future::{join_all, poll_fn},
Future, FutureExt, SinkExt, StreamExt};
use futures_rustls::rustls;
use futures_ticker::Ticker;
use instant::Duration;
use lazy_static::lazy_static;
use libp2p::core::transport::Boxed as BoxedTransport;
use libp2p::core::{ConnectedPoint, Endpoint};
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_p2p/src/behaviours/request_response.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use async_trait::async_trait;
use compatible_time::{Duration, Instant};
use futures::channel::{mpsc, oneshot};
use futures::io::{AsyncRead, AsyncWrite};
use futures::task::Poll;
use futures::StreamExt;
use futures_ticker::Ticker;
use instant::{Duration, Instant};
use libp2p::core::upgrade::{read_length_prefixed, write_length_prefixed};
use libp2p::core::Endpoint;
use libp2p::request_response::{InboundFailure, Message, OutboundFailure, ProtocolSupport};
Expand Down
Loading