From 8a77287eaadb4662389bf262c3d5c3516d23dc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Wed, 26 Jan 2022 09:11:35 +0000 Subject: [PATCH] Fixes CI for our wasm build (#1069) * Feature-locked unused imports * Reverted wasam-bindgen to 0.2.78 to temporarily bypass https://github.com/rustwasm/wasm-bindgen/issues/2774 * Reorganised imports --- clients/webassembly/Cargo.toml | 2 +- .../validator-client/src/client.rs | 25 +++++++++---------- common/wasm-utils/Cargo.toml | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/clients/webassembly/Cargo.toml b/clients/webassembly/Cargo.toml index 7b2f5db6b1..a04d136465 100644 --- a/clients/webassembly/Cargo.toml +++ b/clients/webassembly/Cargo.toml @@ -20,7 +20,7 @@ coconut = ["coconut-interface", "credentials", "gateway-client/coconut"] [dependencies] futures = "0.3" serde = { version = "1.0", features = ["derive"] } -wasm-bindgen = { version = "0.2", features = ["serde-serialize"] } +wasm-bindgen = { version = "=0.2.78", features = ["serde-serialize"] } wasm-bindgen-futures = "0.4" js-sys = "0.3" rand = { version = "0.7.3", features = ["wasm-bindgen"] } diff --git a/common/client-libs/validator-client/src/client.rs b/common/client-libs/validator-client/src/client.rs index 7274e890c5..e21db6ab79 100644 --- a/common/client-libs/validator-client/src/client.rs +++ b/common/client-libs/validator-client/src/client.rs @@ -1,6 +1,15 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 +use crate::{validator_api, ValidatorClientError}; +use coconut_interface::{BlindSignRequestBody, BlindedSignatureResponse, VerificationKeyResponse}; +use mixnet_contract_common::{GatewayBond, IdentityKeyRef, MixNodeBond}; +use url::Url; +use validator_api_requests::models::{ + CoreNodeStatusResponse, MixnodeStatusResponse, RewardEstimationResponse, + StakeSaturationResponse, +}; + #[cfg(feature = "nymd-client")] use crate::nymd::{ error::NymdError, CosmWasmClient, NymdClient, QueryNymdClient, SigningNymdClient, @@ -8,25 +17,15 @@ use crate::nymd::{ #[cfg(feature = "nymd-client")] use mixnet_contract_common::ContractStateParams; -use crate::{validator_api, ValidatorClientError}; -use coconut_interface::{BlindSignRequestBody, BlindedSignatureResponse, VerificationKeyResponse}; #[cfg(feature = "nymd-client")] use mixnet_contract_common::{ - Delegation, Interval, MixnetContractVersion, MixnodeRewardingStatusResponse, + Delegation, IdentityKey, Interval, MixnetContractVersion, MixnodeRewardingStatusResponse, + RewardedSetNodeStatus, RewardedSetUpdateDetails, }; -use mixnet_contract_common::{ - GatewayBond, IdentityKey, IdentityKeyRef, MixNodeBond, RewardedSetNodeStatus, - RewardedSetUpdateDetails, -}; - +#[cfg(feature = "nymd-client")] use std::collections::{HashMap, HashSet}; #[cfg(feature = "nymd-client")] use std::str::FromStr; -use url::Url; -use validator_api_requests::models::{ - CoreNodeStatusResponse, MixnodeStatusResponse, RewardEstimationResponse, - StakeSaturationResponse, -}; #[cfg(feature = "nymd-client")] #[must_use] diff --git a/common/wasm-utils/Cargo.toml b/common/wasm-utils/Cargo.toml index 01b6689524..6c66f52bf3 100644 --- a/common/wasm-utils/Cargo.toml +++ b/common/wasm-utils/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] futures = "0.3" js-sys = "^0.3.51" -wasm-bindgen = "0.2" +wasm-bindgen = "=0.2.78" wasm-bindgen-futures = "0.4" # we don't want entire tokio-tungstenite, tungstenite itself is just fine - we just want message and error enums