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

rpc: expose server-related fields #625

Closed
CharlyCst opened this issue Oct 9, 2020 · 4 comments · Fixed by #636
Closed

rpc: expose server-related fields #625

CharlyCst opened this issue Oct 9, 2020 · 4 comments · Fixed by #636
Labels

Comments

@CharlyCst
Copy link

Hi,

If my understanding is correct, the RPC crate has been design with the goal of exposing types needed by clients to communicate with nodes, and thus hides server-related details.

This is reflected in multiple places, for instance in the endpoints where the fields of Response are public whereas those of Request are private.

However, I'm coming up with the opposite use case: I'm building a mocked node in order to test a client. With the current interface of the RPC crate I'm indeed able to deserialize incoming requests, but I can't access the fields to return a plausible response.

Would it be an option to expose server-related structs and fields to cover both client and server needs?

@adizere
Copy link
Member

adizere commented Oct 13, 2020

Hey, is it correct to say that these are the only changes necessary?

master...CharlyCst:master

@CharlyCst
Copy link
Author

CharlyCst commented Oct 13, 2020

Those are the only one I need at the moment in order to expose the interface I'm interested in, but ideally I would expect all the fields of all the Requests endpoint structs to be public, as it's the case for the Responses (see rpc/src/endpoint/* files).

I can create a PR that makes all of them public if needed.

@thanethomson
Copy link
Contributor

No problem @CharlyCst! Thought I'd just implement it quickly. Mind taking a look at #636 and seeing if that'll meet your needs?

@CharlyCst
Copy link
Author

Yes that's perfect, thank you!

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

Successfully merging a pull request may close this issue.

3 participants