Skip to content

Commit

Permalink
Make timestamp_tolerance_ms is const
Browse files Browse the repository at this point in the history
  • Loading branch information
Dkwcs committed Nov 4, 2024
1 parent 6e71f1e commit cc3eb76
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/iota-e2e-tests/tests/shared_objects_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cc3eb76

Please sign in to comment.