chore: silence wasm warnings (#1404)

This commit is contained in:
Matthias Seitz 2022-06-22 19:09:25 +02:00 committed by GitHub
parent 1ce2310874
commit 40c304d939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 0 deletions

1
Cargo.lock generated
View File

@ -1342,6 +1342,7 @@ dependencies = [
"futures-core",
"futures-timer",
"futures-util",
"getrandom 0.2.7",
"hashers",
"hex",
"http",

View File

@ -47,6 +47,7 @@ hashers = "1.0.1"
tokio = { version = "1.18", features = ["time"] }
tokio-tungstenite = { version = "0.17.1", default-features = false, features = ["connect"], optional = true }
[target.'cfg(target_arch = "wasm32")'.dependencies]
ws_stream_wasm = "0.7"
wasm-bindgen = "0.2"
@ -55,6 +56,8 @@ web-sys = { version = "0.3", features = ["console"] }
wasm-timer = "0.2"
# this is currently necessary for `wasm-timer::Delay` to work
parking_lot = { version = "0.11", features = ["wasm-bindgen"] }
# NOTE: this enables wasm compatibility for getrandom indirectly
getrandom = { version = "0.2", features = ["js"] }
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
tokio = { version = "1.18", default-features = false, features = ["rt", "macros", "time"] }

View File

@ -175,6 +175,7 @@ where
{
type Output = Result<TransactionReceipt, ProviderError>;
#[cfg_attr(target_arch = "wasm32", allow(unused_must_use))]
fn poll(
self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,

View File

@ -167,6 +167,7 @@ macro_rules! rewake_with_new_state_if {
impl<'a, P: JsonRpcClient> Future for PendingTransaction<'a, P> {
type Output = Result<Option<TransactionReceipt>, ProviderError>;
#[cfg_attr(target_arch = "wasm32", allow(unused_must_use))]
fn poll(self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Self::Output> {
let this = self.project();