near / near-jsonrpc-client-rs

Lower-level API for interfacing with the NEAR Protocol via JSONRPC.
https://docs.rs/near-jsonrpc-client
Apache License 2.0
47 stars 43 forks source link

data did not match any variant of untagged enum QueryResponseKind #109

Closed mfornet closed 1 year ago

mfornet commented 2 years ago

I get the following error while using workspace-rs: Error: error while parsing method call result: [data did not match any variant of untagged enum QueryResponseKind] After digging into this, the error seems to be produced in near-jsonrpc-client.

I'm aware there is an error in the code I have that is producing this result, but it is hard to debug the error specifically, given we have no access to the actual output from the RPC. If there is an error, I suggest we attach the original response of the RPC to the error, so it is easier for developers to debug.

miraclx commented 2 years ago

The error should've been properly deserialized into a structured response, can you activate runtime logging and paste a copy of that?

$ RUST_LOG=info,debug ...

mfornet commented 2 years ago

You can find logs here: Logs.

miraclx commented 2 years ago

Just mocked the response and everything seems to work just fine on my end, can you confirm which versions of workspaces and jsonrpc-client you're using?

I know we used to have this issue, but it's been fixed on the most recent version. https://github.com/near/near-jsonrpc-client-rs/issues/74

miraclx commented 1 year ago

@mfornet, this error indeed came up once more in the downstream near-workspaces, https://github.com/near/workspaces-rs/issues/226.

And after even further investigation, I found another reason for this. Which has been patched in #114.

v0.4.1 of this crate should no longer have this issue.

PS: workspaces v0.6.1 now includes this patch. https://github.com/near/workspaces-rs/blob/34bb786470700c7f95b0c88201a58b8792b6dba1/CHANGELOG.md#061