From 3eaf1c29a72eae2d38dc695caa6b14b925e7d397 Mon Sep 17 00:00:00 2001 From: James Kay Date: Wed, 5 Feb 2025 17:39:49 +0000 Subject: [PATCH] `linera-client`: make sure to use `linera_base::time` (#3257) ## Motivation `std::time` will panic if used on `wasm32-unknown-unknown`, since without making additional assumptions about the execution environment no clock syscalls can be used. A `std::time::Duration` is used in `linera_client::client_options`. ## Proposal We have time primitives exported from `linera_base::time` that are Web-safe (using `web-time` on the Web). Replace `std::time::Duration` with `linera_base::time::Duration` in `linera-client`. ## Test Plan ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist) --- linera-client/src/client_options.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linera-client/src/client_options.rs b/linera-client/src/client_options.rs index fd340c6ac33..08c12b6ecb1 100644 --- a/linera-client/src/client_options.rs +++ b/linera-client/src/client_options.rs @@ -6,7 +6,6 @@ use std::{ env, fmt, iter, num::{NonZeroU16, NonZeroUsize}, path::PathBuf, - time::Duration, }; use chrono::{DateTime, Utc}; @@ -17,6 +16,7 @@ use linera_base::{ Account, ApplicationId, BytecodeId, ChainId, MessageId, Owner, UserApplicationId, }, ownership::{ChainOwnership, TimeoutConfig}, + time::Duration, }; use linera_core::{client::BlanketMessagePolicy, DEFAULT_GRACE_PERIOD}; use linera_execution::{