Skip to content

Commit

Permalink
fix: add getrandom with js feature for wasm (#2076)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Jan 27, 2023
1 parent 8ed95f1 commit ff05a87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ethers-core/Cargo.toml
Expand Up @@ -47,6 +47,10 @@ num_enum = "0.5.9"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tempfile = { version = "3.3.0", default-features = false }

[target.'cfg(target_arch = "wasm32")'.dependencies]
# NOTE: this enables wasm compatibility for getrandom indirectly
getrandom = { version = "0.2", features = ["js"] }

[dev-dependencies]
serde_json = { version = "1.0.64", default-features = false }
bincode = { version = "1.3.3", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion ethers-core/src/lib.rs
@@ -1,7 +1,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc = include_str!("../README.md")]
#![deny(rustdoc::broken_intra_doc_links)]
#![deny(unused_crate_dependencies)]
#![cfg_attr(not(target_arch = "wasm32"), deny(unused_crate_dependencies))]

pub mod types;

Expand Down

0 comments on commit ff05a87

Please sign in to comment.