-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add specific functions to RPC trait #573
Comments
I've been thinking on this and don't believe this is the best approach. In my opinion, the I propose keeping I'd love to hear your thoughts on this. |
I think that should be fine. Either keeping the trait as it is, and maybe adding a new mod/struct that handles the more specific methods within it, or separating them on The other alternative (maybe more in line with what we do with |
I think proving some more specialized methods that rely on the "core" methods is good idea. The way to think about these is that the provide a subset of the functionality exposed by the core methods (assuming this subset is actually useful). But I wouldn't go beyond that and move business logic into the Not sure how many such methods there are, but I think the one in the original post is a good example. We have a more general |
I've been reviewing the places where we use the rpc functions. I think there are some places where we do an rpc call and then do some post processing which we could move to a specific function which uses the base rpc functions. Here are some of these examples I found (the names could be changed, I haven't put much thought into them):
|
addressed by #616 |
Currently, most (if not all) of the functions included in the RPC trait are correlated 1:1 with the node RPC endpoints.
However, it might be better if the trait functions were specifically suited for use-cases instead. For example, instead of using RPC's
NodeRpcClient::get_account_proofs() -> (u32, Vec<AccountProof>)
for foreign accounts (whereAccountProof
may or may not include headers, depending on what was requested to the node), we could instead add a specific function that returns data useful for FPI (ie, something likeNodeRpcClient::get_accounts_for_fpi() -> (u32, Vec<FpiAccountData>)
whereFpiAccountData
always contains account code, storage header and account header.The text was updated successfully, but these errors were encountered: