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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
- name: Test
run: |
wget -O - https://raw.githubusercontent.com/KomodoPlatform/komodo/635112d590618165a152dfa0f31e95a9be39a8f6/zcutil/fetch-params-alt.sh | bash
cargo test --test 'mm2_tests_main' --features for-tests --no-fail-fast
cargo test --test 'mm2_tests_main' --no-fail-fast

mac-x86-64-kdf-integration:
timeout-minutes: 90
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
- name: Test
run: |
wget -O - https://raw.githubusercontent.com/KomodoPlatform/komodo/635112d590618165a152dfa0f31e95a9be39a8f6/zcutil/fetch-params-alt.sh | bash
cargo test --test 'mm2_tests_main' --features for-tests --no-fail-fast
cargo test --test 'mm2_tests_main' --no-fail-fast

win-x86-64-kdf-integration:
timeout-minutes: 90
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
- name: Test
run: |
Invoke-WebRequest -Uri https://raw.githubusercontent.com/KomodoPlatform/komodo/635112d590618165a152dfa0f31e95a9be39a8f6/zcutil/fetch-params-alt.bat -OutFile \cmd.bat && \cmd.bat
cargo test --test 'mm2_tests_main' --features for-tests --no-fail-fast
cargo test --test 'mm2_tests_main' --no-fail-fast

docker-tests:
timeout-minutes: 90
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/lightning/ln_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ mod tests {
PaymentType::InboundPayment
};
let status_rng: u8 = rng.gen();
let status = if status_rng % 3 == 0 {
let status = if status_rng.is_multiple_of(3) {
HTLCStatus::Succeeded
} else if status_rng % 3 == 1 {
HTLCStatus::Pending
Expand Down
12 changes: 9 additions & 3 deletions mm2src/coins/nft/storage/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::eth::EthTxFeeDetails;
use crate::nft::nft_structs::{
Chain, Nft, NftList, NftListFilters, NftTokenAddrId, NftTransferHistory, NftTransferHistoryFilters,
NftsTransferHistoryList, TransferMeta,
Expand All @@ -7,11 +6,16 @@ use async_trait::async_trait;
use ethereum_types::Address;
use mm2_err_handle::mm_error::MmResult;
use mm2_err_handle::mm_error::NotMmError;
use mm2_number::{BigDecimal, BigUint};
use serde::{Deserialize, Serialize};
use mm2_number::BigUint;
use std::collections::HashSet;
use std::num::NonZeroUsize;

cfg_native! {
use crate::eth::EthTxFeeDetails;
use mm2_number::BigDecimal;
use serde::{Deserialize, Serialize};
}

#[cfg(any(test, target_arch = "wasm32"))]
pub(crate) mod db_test_helpers;
#[cfg(not(target_arch = "wasm32"))]
Expand Down Expand Up @@ -231,6 +235,7 @@ fn get_offset_limit(max: bool, limit: usize, page_number: Option<NonZeroUsize>,

/// `NftDetailsJson` structure contains immutable parameters that are not needed for queries.
/// This is what `details_json` string contains in db table.
#[cfg(not(target_arch = "wasm32"))]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub(crate) struct NftDetailsJson {
pub(crate) owner_of: Address,
Expand All @@ -241,6 +246,7 @@ pub(crate) struct NftDetailsJson {

/// `TransferDetailsJson` structure contains immutable parameters that are not needed for queries.
/// This is what `details_json` string contains in db table.
#[cfg(not(target_arch = "wasm32"))]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub(crate) struct TransferDetailsJson {
pub(crate) block_hash: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_bitcoin/keys/src/segwitaddress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ mod tests {
use Public;

fn hex_to_bytes(s: &str) -> Option<Vec<u8>> {
if s.len() % 2 == 0 {
if s.len().is_multiple_of(2) {
(0..s.len())
.step_by(2)
.map(|i| s.get(i..i + 2).and_then(|sub| u8::from_str_radix(sub, 16).ok()))
Expand Down
19 changes: 2 additions & 17 deletions mm2src/mm2_main/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ custom-swap-locktime = [] # only for testing purposes, should never be activated
native = [] # Deprecated
track-ctx-pointer = ["common/track-ctx-pointer"]
zhtlc-native-tests = ["coins/zhtlc-native-tests"]
run-docker-tests = ["for-tests", "coins/run-docker-tests"]
run-docker-tests = ["coins/run-docker-tests"]
default = []
trezor-udp = ["crypto/trezor-udp"] # use for tests to connect to trezor emulator over udp
run-device-tests = []
Expand All @@ -29,12 +29,7 @@ new-db-arch = ["mm2_core/new-db-arch"] # A temporary feature to integrate the ne
# Temporary feature for implementing IBC wrap/unwrap mechanism and will be removed
# once we consider it as stable.
ibc-routing-for-swaps = []
for-tests = [
"coins/for-tests",
"coins_activation/for-tests",
"common/for-tests",
"trading_api/for-tests"
]
for-tests = []
enable-solana = ["coins/enable-solana", "coins_activation/enable-solana"]

[dependencies]
Expand Down Expand Up @@ -162,13 +157,3 @@ gstuff.workspace = true
prost-build = { version = "0.12", default-features = false }
regex.workspace = true

[[test]]
name = "docker_tests_main"
path = "tests/docker_tests_main.rs"
required-features = ["run-docker-tests"]

[[test]]
name = "mm2_tests_main"
path = "tests/mm2_tests_main.rs"
required-features = ["for-tests"]

Loading
Loading