Skip to content

Commit

Permalink
fix: Move contract key generation before CreatedRoom initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 23, 2024
1 parent a6c36d1 commit 671cbba
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ui/src/example_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(&parameters);
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(&parameters);
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(),
Expand Down

0 comments on commit 671cbba

Please sign in to comment.