diff --git a/fastpay_core/src/unit_tests/authority_tests.rs b/fastpay_core/src/unit_tests/authority_tests.rs index 47a177f1f08c3..e37f3651664e7 100644 --- a/fastpay_core/src/unit_tests/authority_tests.rs +++ b/fastpay_core/src/unit_tests/authority_tests.rs @@ -1165,7 +1165,8 @@ async fn test_get_latest_parent_entry() { // The objects just after the gas object also returns None let mut x = gas_object_id.to_vec(); let last_index = x.len() - 1; - x[last_index] += 1; + // Prevent overflow + x[last_index] = u8::MAX - x[last_index]; let unknown_object_id: ObjectID = x.try_into().unwrap(); assert!(authority_state .get_latest_parent_entry(unknown_object_id)