fix: add getrandom with js feature for wasm (#2076)

This commit is contained in:
Matthias Seitz 2023-01-27 19:14:26 +01:00 committed by GitHub
parent 8ed95f1363
commit ff05a8762b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

1
Cargo.lock generated
View File

@ -1409,6 +1409,7 @@ dependencies = [
"elliptic-curve",
"ethabi",
"generic-array 0.14.6",
"getrandom 0.2.8",
"hex",
"hex-literal",
"k256",

View File

@ -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 }

View File

@ -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;