use std::sync::Arc; use karyon_jsonrpc::{rpc_pubsub_impl, Channel, PubSubRPCService, RPCError}; use serde_json::Value; #[test] fn rpc_pubsub_impl_service() { struct Foo {} #[rpc_pubsub_impl] impl Foo { async fn foo( &self, _channel: Arc, _method: String, params: Value, ) -> Result { Ok(params) } } let f = Arc::new(Foo {}); assert!(f.get_pubsub_method("foo").is_some()); assert!(f.get_pubsub_method("bar").is_none()); let _params = serde_json::json!("params"); // TODO add more tests here }