-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(proc-macros): make feature server-core
compile
#1360
Conversation
server-core
server-core
compile
But there are already some reexports in the existing code, such as jsonrpsee/proc-macros/src/render_server.rs Line 383 in 0379bc4
|
Yes you are correct but we have a couple of re-exports there but these should be as few a possible IMO. |
@niklasad1 There is still a problem when using the
|
And I found another issue about the [package]
name = "rpc-demo"
version = "0.1.0"
edition = "2021"
[dependencies]
jsonrpsee = { version = "0.22.4", features = ["client-core", "server-core", "macros"] }
serde = { version = "1.0", features = ["derive"] }
[patch.crates-io]
jsonrpsee = { path = "../parity/jsonrpsee/jsonrpsee" } use jsonrpsee::{core::SubscriptionResult, proc_macros::rpc};
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub enum PubSubKind {
A,
B,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PubSubParams {
params: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PubSubItem {
result: String,
}
#[rpc(client, server, namespace = "foo")]
#[async_trait]
pub trait FooPubSubApi {
// Error
#[subscription(name = "subscribe" => "subscription", unsubscribe = "unsubscribe", item = PubSubItem)]
async fn sub(&self, kind: PubSubKind, params: Option<PubSubParams>) -> SubscriptionResult;
// Ok
// #[subscription(name = "subscribe" => "subscription", unsubscribe = "unsubscribe", item = PubSubItem)]
// async fn sub(&self, kind: PubSubKind, pubsub_params: Option<PubSubParams>) -> SubscriptionResult;
} Error:
|
You should be unblocked after I merged #1361 but please open issues if something doesn't work |
@niklasad1 there is still a problem about the parameter name, although I can use other names to avoid this issue. jsonrpsee/proc-macros/src/render_client.rs Lines 242 to 254 in c908eeb
|
@koushiro I can't reproduce that please open an issue how to reproduce it.... |
Similar to #1359 and kudos to @koushiro for detecting this but I prefer not re-export tokio