Skip to content

Commit

Permalink
fix: add js to getrandom for wasm32
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-atreya committed Jan 10, 2025
1 parent ab907d7 commit bec14d9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/alloy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ std = [
"alloy-consensus?/std",
]

# essential features that enable bare minimal network interactions out of the box.
# essential features that enable basic network interactions out of the box.
essentials = ["contract", "provider-http", "rpc-types", "signer-local"]

# full
Expand Down
3 changes: 3 additions & 0 deletions crates/contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ thiserror.workspace = true

alloy-pubsub = { workspace = true, optional = true }

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

[dev-dependencies]
alloy-consensus.workspace = true
alloy-rpc-client = { workspace = true, features = ["pubsub", "ws"] }
Expand Down
3 changes: 3 additions & 0 deletions crates/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true

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

[dev-dependencies]

[features]
Expand Down
3 changes: 3 additions & 0 deletions crates/node-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ thiserror.workspace = true
tracing.workspace = true
url.workspace = true

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

[dev-dependencies]
ci_info.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
1 change: 1 addition & 0 deletions crates/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ url = { workspace = true, optional = true }
parking_lot.workspace = true
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasmtimer.workspace = true
getrandom = { version = "0.2", features = ["js"] }

[dev-dependencies]
alloy-consensus = { workspace = true, features = ["kzg"] }
Expand Down
3 changes: 3 additions & 0 deletions crates/signer-local/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ yubihsm = { version = "0.42", features = [
"usb",
], optional = true }

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

[dev-dependencies]
alloy-dyn-abi.workspace = true
alloy-sol-types.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ alloy-dyn-abi = { workspace = true, optional = true, features = [
"eip712",
] }

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

[dev-dependencies]
assert_matches.workspace = true
serde.workspace = true
Expand Down

0 comments on commit bec14d9

Please sign in to comment.