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

Typed request/response #46

Open
mfornet opened this issue Feb 3, 2022 · 1 comment
Open

Typed request/response #46

mfornet opened this issue Feb 3, 2022 · 1 comment

Comments

@mfornet
Copy link
Member

mfornet commented Feb 3, 2022

Looking at [this example](https://github.com/near/near-jsonrpc-client-rs/blob/master/examples/contract_view_method.rs) I wonder if we can have an updated interface, where if a CallFunction was used as a request, then the response is a CallResult and it is not required to match against QueryResponseKind.

@miraclx
Copy link
Collaborator

miraclx commented Feb 3, 2022

Yeah, that's one of the pain points of the type-system we've highlighted so far. I guess, semantically speaking, it sorta makes sense: as there are multiple types of query requests, so too there should be multiple types of query responses. However, we expect to smoothen out cases like that in the higher-level near-api-rs down the line.

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

No branches or pull requests

2 participants