Skip to content

Commit

Permalink
fix: replace wasm-timer with zduny-wasm-timer (#290)
Browse files Browse the repository at this point in the history
This fixes running helis-ts in a webworker environment
  • Loading branch information
orenyomtov authored Oct 24, 2023
1 parent d2da305 commit 4e221c1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
48 changes: 24 additions & 24 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ thiserror = "1.0.37"
superstruct = "0.7.0"
openssl = { version = "0.10", features = ["vendored"] }
hyper = "0.14.23"
wasm-timer = "0.2.5"
zduny-wasm-timer = "0.2.8"
backoff = { version = "0.4.0", features = ["tokio"] }

######################################
Expand Down
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ futures.workspace = true
tracing.workspace = true
thiserror.workspace = true
tokio.workspace = true
wasm-timer.workspace = true
zduny-wasm-timer.workspace = true

common = { path = "../common" }
consensus = { path = "../consensus" }
Expand Down
2 changes: 1 addition & 1 deletion client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use common::types::{Block, BlockTag};
use config::Config;
use execution::types::CallOpts;
use tracing::{info, warn};
use wasm_timer::Delay;
use zduny_wasm_timer::Delay;

use crate::node::Node;

Expand Down
2 changes: 1 addition & 1 deletion client/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ethers::types::{
Filter, Log, SyncProgress, SyncingStatus, Transaction, TransactionReceipt, H256,
};
use eyre::{eyre, Result};
use wasm_timer::{SystemTime, UNIX_EPOCH};
use zduny_wasm_timer::{SystemTime, UNIX_EPOCH};

use common::types::{Block, BlockTag};
use config::Config;
Expand Down
2 changes: 1 addition & 1 deletion consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tracing.workspace = true
chrono.workspace = true
thiserror.workspace = true
superstruct.workspace = true
wasm-timer.workspace = true
zduny-wasm-timer.workspace = true
backoff.workspace = true

common = { path = "../common" }
Expand Down
4 changes: 2 additions & 2 deletions consensus/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use milagro_bls::PublicKey;
use ssz_rs::prelude::*;
use tokio::sync::mpsc::Sender;
use tracing::{debug, error, info, warn};
use wasm_timer::{SystemTime, UNIX_EPOCH};
use zduny_wasm_timer::{SystemTime, UNIX_EPOCH};

use tokio::sync::mpsc::channel;
use tokio::sync::mpsc::Receiver;
Expand Down Expand Up @@ -112,7 +112,7 @@ impl<R: ConsensusRpc, DB: Database> ConsensusClient<R, DB> {
_ = inner.send_blocks().await;

loop {
wasm_timer::Delay::new(inner.duration_until_next_update().to_std().unwrap())
zduny_wasm_timer::Delay::new(inner.duration_until_next_update().to_std().unwrap())
.await
.unwrap();

Expand Down

0 comments on commit 4e221c1

Please sign in to comment.