From cc3eb76441ff9264a615e5225ad1335f0f826d7b Mon Sep 17 00:00:00 2001 From: Dkwcs Date: Mon, 4 Nov 2024 17:55:26 +0200 Subject: [PATCH] Make timestamp_tolerance_ms is const --- crates/iota-e2e-tests/tests/shared_objects_tests.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/iota-e2e-tests/tests/shared_objects_tests.rs b/crates/iota-e2e-tests/tests/shared_objects_tests.rs index 41f16bc6114..016beb949e2 100644 --- a/crates/iota-e2e-tests/tests/shared_objects_tests.rs +++ b/crates/iota-e2e-tests/tests/shared_objects_tests.rs @@ -28,6 +28,9 @@ use rand::distributions::Distribution; use test_cluster::TestClusterBuilder; use tokio::time::sleep; +// Permitted timestamp tolerance for calculating potential time delay +const TIMESTAMP_TOLERANCE_MS: u64 = 500; + /// Send a simple shared object transaction to Iota and ensures the client gets /// back a response. #[sim_test] @@ -470,8 +473,6 @@ async fn call_shared_object_contract() { #[sim_test] async fn access_clock_object_test() { - // Permitted timestamp tolerance for calculating potential time delay - let timestamp_tolerance_ms: u64 = 500; let test_cluster = TestClusterBuilder::new().build().await; let package_id = publish_basics_package(&test_cluster.wallet).await.0; @@ -540,7 +541,7 @@ async fn access_clock_object_test() { // should match timestamp of the checkpoint where transaction is included assert!( (checkpoint.timestamp_ms as i64 - event.timestamp_ms as i64).abs() - <= timestamp_tolerance_ms as i64, + <= TIMESTAMP_TOLERANCE_MS as i64, "timestamps are not within the allowed tolerance. Checkpoint: {}, Event: {}", checkpoint.timestamp_ms, event.timestamp_ms