Skip to main content

calimero_context/handlers/
sync.rs

1use actix::{Handler, Message};
2use calimero_context_primitives::messages::SyncRequest;
3
4use crate::ContextManager;
5
6impl Handler<SyncRequest> for ContextManager {
7    type Result = <SyncRequest as Message>::Result;
8
9    fn handle(
10        &mut self,
11        SyncRequest {
12            context_id,
13            application_id,
14        }: SyncRequest,
15        _ctx: &mut Self::Context,
16    ) -> Self::Result {
17        if let Some(context) = self.contexts.get_mut(&context_id) {
18            context.meta.application_id = application_id;
19        }
20    }
21}