From 42e966662a42aaa1ad765550ab404e19cbf53087 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 22 Jun 2022 19:12:11 +0200 Subject: [PATCH] chore: make ethers-etherscan compile for wasm32 (#1403) --- Cargo.lock | 1 + ethers-etherscan/Cargo.toml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index bcc56df3..73cd0bd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1288,6 +1288,7 @@ version = "0.13.0" dependencies = [ "ethers-core", "ethers-solc", + "getrandom 0.2.7", "reqwest", "semver", "serde", diff --git a/ethers-etherscan/Cargo.toml b/ethers-etherscan/Cargo.toml index 4927047a..d84f9c9d 100644 --- a/ethers-etherscan/Cargo.toml +++ b/ethers-etherscan/Cargo.toml @@ -23,6 +23,10 @@ thiserror = "1.0" tracing = "0.1.35" semver = "1.0.10" +[target.'cfg(target_arch = "wasm32")'.dependencies] +# NOTE: this enables wasm compatibility for getrandom indirectly +getrandom = { version = "0.2", features = ["js"] } + [dev-dependencies] tempfile = "3.3.0" tokio = { version = "1.18", features = ["macros", "rt-multi-thread", "time"] }