diff --git a/crates/sui/tests/shared_objects_tests.rs b/crates/sui/tests/shared_objects_tests.rs index 1c246939c6074..06ed21410ac90 100644 --- a/crates/sui/tests/shared_objects_tests.rs +++ b/crates/sui/tests/shared_objects_tests.rs @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 use std::sync::Arc; +use sui_core::authority_client::AuthorityAPI; use sui_core::gateway_state::{GatewayAPI, GatewayState}; -use sui_types::messages::{CallArg, ExecutionStatus}; +use sui_types::messages::{CallArg, ExecutionStatus, ObjectInfoRequest, ObjectInfoRequestKind}; use sui_types::object::OBJECT_START_VERSION; -use test_utils::authority::test_authority_aggregator; +use test_utils::authority::{get_client, test_authority_aggregator}; use test_utils::transaction::{ publish_counter_package, submit_shared_object_transaction, submit_single_owner_transaction, }; @@ -247,6 +248,28 @@ async fn shared_object_sync() { assert!(matches!(effects.status, ExecutionStatus::Success { .. })); let ((counter_id, _, _), _) = effects.created[0]; + // Check that the counter object only exist in the first validator, but not the rest. + get_client(&configs.validator_set()[0]) + .handle_object_info_request(ObjectInfoRequest { + object_id: counter_id, + request_kind: ObjectInfoRequestKind::LatestObjectInfo(None), + }) + .await + .unwrap() + .object() + .unwrap(); + for config in configs.validator_set().iter().skip(1) { + assert!(get_client(config) + .handle_object_info_request(ObjectInfoRequest { + object_id: counter_id, + request_kind: ObjectInfoRequestKind::LatestObjectInfo(None), + }) + .await + .unwrap() + .object() + .is_none()); + } + // Make a transaction to increment the counter. tokio::task::yield_now().await; let increment_counter_transaction = move_transaction(