Skip to content
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

[proc macros]: generated unsubscribe methods with subscribe in method name doesn't work. #698

Closed
niklasad1 opened this issue Feb 14, 2022 · 1 comment

Comments

@niklasad1
Copy link
Member

niklasad1 commented Feb 14, 2022

#[rpc(client)]
pub trait RpcApi {
       #[subscription(
		name = "author_submitAndWatchExtrinsic" => "author_extrinsicUpdate",
		item = TransactionStatus<Hash, Hash>,
	)]
	fn watch_extrinsic(&self, bytes: &Bytes) -> RpcResult<()>;
}

This will generate -> "unsubscribeauthor_submitAndWatchExtrinsic", see https://github.com/paritytech/jsonrpsee/blob/master/proc-macros/src/rpc_macro.rs#L342-#L344

For the servers that shouldn't matter much but for the clients it's a big concern i.e, the unsubscribe won't work properly.
So maybe it could make sense return Option<String> instead and require users to provide unsubscribe if not the method starts with subscribe

@niklasad1
Copy link
Member Author

Closed by #702

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant