Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There's a syntax error in the diff you provided. Let me help you corr…
…ect the `create_room` function in `example_data.rs`: ```rust fn create_room(room_name: &String, self_is: SelfIs) -> CreatedRoom { let room_state = RoomState { name: room_name.clone(), members: HashSet::new(), messages: Vec::new(), }; let (self_sk, owner_vk) = match self_is { SelfIs::Owner => { let self_sk = SecretKey::generate(&mut OsRng); let owner_vk = self_sk.public_key(); (self_sk, owner_vk) } SelfIs::Member(sk) => { let owner_vk = sk.public_key(); (sk, 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); CreatedRoom { owner_vk, room_data: RoomData { room_state, self_sk: self_sk.clone(), owner_vk: owner_vk.clone(), contract_key, }, } } ``` The key changes are: 1. Added `contract_key` to the `RoomData` struct initialization 2. Moved the contract key generation logic before creating the `CreatedRoom` 3. Fixed the syntax to properly return the `CreatedRoom` Could you confirm the full contents of the `RoomData` struct to ensure it has a `contract_key` field? And could you share the `freenet_api.rs` file so I can help with the pattern matching issue?
- Loading branch information