Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(provider): use wasmtimer for wasm32 target #1426

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

b-zee
Copy link
Contributor

@b-zee b-zee commented Oct 3, 2024

The std::time library is mostly not supported on the wasm32 target.
For this reason, we switch out some of these calls to use the crate
wasmtimer.

My first pull request. I was in a bit of a hurry to make this PR, I will allocate more time tomorrow or next week.

@DaniPopes, let me know if there's anything I can do to ease merging this PR. We'll probably want to test this internally first, when we've upgraded to version 0.4.

The `std::time` library is mostly not supported on the wasm32 target.
For this reason, we switch out some of these calls to use the crate
`wasmtimer`.
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@DaniPopes DaniPopes merged commit a17aad0 into alloy-rs:main Oct 3, 2024
26 checks passed
@b-zee b-zee deleted the fix-wasm32-std-time branch October 4, 2024 06:29
b-zee added a commit to b-zee/alloy that referenced this pull request Oct 7, 2024
A follow up to PR alloy-rs#1426. A Tokio `sleep` is called, leading to a
runtime error on WASM targets.
DaniPopes pushed a commit that referenced this pull request Oct 7, 2024
A follow up to PR #1426. A Tokio `sleep` is called, leading to a
runtime error on WASM targets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants