Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(autonomi): fix wasm warnings from cargo check #2355

Merged
merged 2 commits into from
Nov 8, 2024
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
5 changes: 5 additions & 0 deletions .github/workflows/cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
run: wasm-pack build --dev --target=web autonomi
timeout-minutes: 30

- name: Cargo check for WASM
# Allow clippy lints (these can be pedantic on WASM), but deny regular Rust warnings
run: cargo clippy --target=wasm32-unknown-unknown --package=autonomi --all-targets -- --allow=clippy::all --deny=warnings
timeout-minutes: 30

websocket:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: Standard Websocket builds
Expand Down
1 change: 1 addition & 0 deletions sn_networking/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ impl ContinuousBootstrap {

/// Returns `true` if we should carry out the Kademlia Bootstrap process immediately.
/// Also optionally returns the new interval to re-bootstrap.
#[cfg_attr(target_arch = "wasm32", allow(clippy::unused_async))]
pub(crate) async fn should_we_bootstrap(
&self,
peers_in_rt: u32,
Expand Down
18 changes: 11 additions & 7 deletions sn_networking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ mod transfers;
mod transport;

use cmd::LocalSwarmCmd;
use sn_registers::SignedRegister;
use xor_name::XorName;

// re-export arch dependent deps for use in the crate, or above
Expand Down Expand Up @@ -62,15 +61,11 @@ use sn_evm::{AttoTokens, PaymentQuote, QuotingMetrics, RewardsAddress};
use sn_protocol::{
error::Error as ProtocolError,
messages::{ChunkProof, Cmd, Nonce, Query, QueryResponse, Request, Response},
storage::{
try_deserialize_record, try_serialize_record, RecordHeader, RecordKind, RecordType,
RetryStrategy,
},
storage::{RecordType, RetryStrategy},
NetworkAddress, PrettyPrintKBucketKey, PrettyPrintRecordKey, CLOSE_GROUP_SIZE,
};
use sn_transfers::SignedSpend;
use std::{
collections::{BTreeMap, HashMap, HashSet},
collections::{BTreeMap, HashMap},
net::IpAddr,
sync::Arc,
};
Expand All @@ -79,6 +74,15 @@ use tokio::sync::{
oneshot,
};
use tokio::time::Duration;
#[cfg(not(target_arch = "wasm32"))]
use {
sn_protocol::storage::{
try_deserialize_record, try_serialize_record, RecordHeader, RecordKind,
},
sn_registers::SignedRegister,
sn_transfers::SignedSpend,
std::collections::HashSet,
};

/// The type of quote for a selected payee.
pub type PayeeQuote = (PeerId, RewardsAddress, PaymentQuote);
Expand Down
Loading