From 671cbbaaac2b51533b045243ce0026f00edf5c20 Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Mon, 23 Dec 2024 12:57:27 -0600 Subject: [PATCH] fix: Move contract key generation before CreatedRoom initialization --- ui/src/example_data.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ui/src/example_data.rs b/ui/src/example_data.rs index de870b8..1978400 100644 --- a/ui/src/example_data.rs +++ b/ui/src/example_data.rs @@ -173,17 +173,17 @@ fn create_room(room_name: &String, self_is: SelfIs) -> CreatedRoom { ); } + // Generate contract key for the room + let parameters = ChatRoomParametersV1 { + owner: owner_vk, + }; + let params_bytes = to_cbor_vec(¶meters); + let contract_code = ContractCode::from(ROOM_CONTRACT_WASM); + let instance_id = ContractInstanceId::from_params_and_code(Parameters::from(params_bytes), contract_code); + let contract_key = ContractKey::from(instance_id); + CreatedRoom { owner_vk, - // Generate contract key for the room - let parameters = ChatRoomParametersV1 { - owner: owner_vk, - }; - let params_bytes = to_cbor_vec(¶meters); - let contract_code = ContractCode::from(ROOM_CONTRACT_WASM); - let instance_id = ContractInstanceId::from_params_and_code(Parameters::from(params_bytes), contract_code); - let contract_key = ContractKey::from(instance_id); - room_data: RoomData { room_state, self_sk: self_sk.clone(),