Skip to content

Commit

Permalink
fix: wasm compatibility
Browse files Browse the repository at this point in the history
The `js` feature on `getrandom` needs to be enabled for wasm builds.
This was previously handled by `starknet-ff`, which is now removed.
  • Loading branch information
xJonathanLEI committed May 16, 2024
1 parent 2ad8146 commit 9d9a323
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions starknet-providers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ serde_json = "1.0.96"
serde_with = "2.3.2"
starknet-types-core = { version = "0.1.1", default-features = false , features = ["serde", "curve"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2.9", features = ["js"] }

[dev-dependencies]
starknet-providers = { path = ".", features = ["no_unknown_fields"] }
tokio = { version = "1.27.0", features = ["full"] }
Expand Down
3 changes: 3 additions & 0 deletions starknet-signers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ starknet-types-core = { version = "0.1.1", default-features = false, features =
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
eth-keystore = { version = "0.5.0", default-features = false }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2.9", features = ["js"] }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3.34"

0 comments on commit 9d9a323

Please sign in to comment.