sui_rpc_api/grpc/alpha/
event_service.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::RpcService;
5use crate::grpc::alpha::event_service_proto::event_service_server::EventService;
6use crate::grpc::alpha::event_service_proto::{
7    ListAuthenticatedEventsRequest, ListAuthenticatedEventsResponse,
8};
9use crate::grpc::alpha::list_authenticated_events;
10
11#[tonic::async_trait]
12impl EventService for RpcService {
13    async fn list_authenticated_events(
14        &self,
15        request: tonic::Request<ListAuthenticatedEventsRequest>,
16    ) -> Result<tonic::Response<ListAuthenticatedEventsResponse>, tonic::Status> {
17        let req = request.into_inner();
18        let resp: ListAuthenticatedEventsResponse =
19            list_authenticated_events::list_authenticated_events(self, req)
20                .map_err(tonic::Status::from)?;
21        Ok(tonic::Response::new(resp))
22    }
23}