Skip to main content

xmtp_api_backend/endpoints/backend/
mod.rs

1mod publish;
2pub use publish::Publish;
3mod query;
4pub use query::Query;
5mod query_newest;
6pub use query_newest::QueryNewest;
7mod get_inbox_ids;
8pub use get_inbox_ids::GetInboxIds;
9mod get_configuration;
10pub use get_configuration::{GET_CONFIGURATION_PATH, GetConfiguration};
11mod verify_smart_contract_wallet_signatures;
12pub use verify_smart_contract_wallet_signatures::VerifySmartContractWalletSignatures;
13mod subscribe_static;
14pub use subscribe_static::SubscribeStatic;
15mod register;
16pub use register::Register;
17mod unregister;
18pub use unregister::Unregister;
19mod update_subscriptions;
20pub use update_subscriptions::UpdateSubscriptions;
21
22#[cfg(test)]
23mod tests {
24    use super::*;
25    use xmtp_proto::api::Endpoint;
26
27    #[xmtp_common::test(unwrap_try = true)]
28    fn endpoint_paths_match_backend_services() {
29        let paths = [
30            (
31                Publish(Default::default()).grpc_endpoint(),
32                "/xmtp.backend.v1.PublishService/Publish",
33            ),
34            (
35                Query(Default::default()).grpc_endpoint(),
36                "/xmtp.backend.v1.QueryService/Query",
37            ),
38            (
39                QueryNewest(Default::default()).grpc_endpoint(),
40                "/xmtp.backend.v1.QueryService/QueryNewest",
41            ),
42            (
43                GetInboxIds(Default::default()).grpc_endpoint(),
44                "/xmtp.backend.v1.IdentityService/GetInboxIds",
45            ),
46            (
47                GetConfiguration(Default::default()).grpc_endpoint(),
48                "/xmtp.backend.v1.ConfigurationService/GetConfiguration",
49            ),
50            (
51                VerifySmartContractWalletSignatures(Default::default()).grpc_endpoint(),
52                "/xmtp.backend.v1.IdentityService/VerifySmartContractWalletSignatures",
53            ),
54            (
55                SubscribeStatic(Default::default()).grpc_endpoint(),
56                "/xmtp.backend.v1.SubscriptionService/SubscribeStatic",
57            ),
58            (
59                Register(Default::default()).grpc_endpoint(),
60                "/xmtp.backend.v1.NotificationService/Register",
61            ),
62            (
63                Unregister(Default::default()).grpc_endpoint(),
64                "/xmtp.backend.v1.NotificationService/Unregister",
65            ),
66            (
67                UpdateSubscriptions(Default::default()).grpc_endpoint(),
68                "/xmtp.backend.v1.NotificationService/UpdateSubscriptions",
69            ),
70        ];
71        for (actual, expected) in paths {
72            assert_eq!(actual, expected);
73        }
74    }
75}