Skip to content

Commit 282dfa3

Browse files
authored
linera-core: make sure to use Web-compatible time primitives (#4302)
## Motivation #4265 moved some uses of `std::time` primitives out of benchmarking-specific code and into the main codepath of `linera-core`. Unfortunately, `std::time` primitives panic on Wasm, so we must always remember to use `linera_base::time` for anything that may be compiled for the Web (or, as a rule of thumb, anywhere in the codebase: I don't think there's any harm to it). ## Proposal Make sure to use the Web-compatible time shim in `linera-base`. ## Test Plan Test in Web demos. ## Release Plan - Nothing to do / These changes follow the usual release cycle. Thankfully we haven't released a devnet with this bug yet. ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 0d964ab commit 282dfa3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

linera-core/src/client/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use std::{
88
iter,
99
ops::{Deref, DerefMut},
1010
sync::{Arc, RwLock},
11-
time::{Duration, Instant},
1211
};
1312

1413
use chain_client_state::ChainClientState;
@@ -36,6 +35,7 @@ use linera_base::{
3635
ModuleId, StreamId,
3736
},
3837
ownership::{ChainOwnership, TimeoutConfig},
38+
time::{Duration, Instant},
3939
};
4040
#[cfg(not(target_arch = "wasm32"))]
4141
use linera_base::{data_types::Bytecode, vm::VmRuntime};

0 commit comments

Comments
 (0)