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

Response implementation of Deserialize is not general enough #1106

Open
aniketfuryrocks opened this issue May 1, 2023 Discussed in #1105 · 0 comments
Open

Response implementation of Deserialize is not general enough #1106

aniketfuryrocks opened this issue May 1, 2023 Discussed in #1105 · 0 comments

Comments

@aniketfuryrocks
Copy link

Discussed in #1105

Originally posted by aniketfuryrocks May 1, 2023
@niklasad1 I am porting tests here

with jsonrpc

https://github.com/blockworks-foundation/solana/blob/bd782634dcd39d267381a55e7a8c5d52ab314292/rpc/src/rpc.rs#L5914

now

    let expected = serde_json::json!({
        "jsonrpc":"2.0",
        "error": {
            "code": -32003,
            "message": "Transaction signature verification failure"
        },
        "id":1
    });

    let value: jsonrpsee::types::Response<()> = serde_json::from_value(expected).unwrap();

    println!("{:?}", value.to_string());

error

error: implementation of `Deserialize` is not general enough
  --> src/main.rs:54:49
   |
54 |     let value: jsonrpsee::types::Response<()> = serde_json::from_value(expected).unwrap();
   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Deserialize` is not general enough
   |
   = note: `Deserialize<'0>` would have to be implemented for the type `Response<'_, ()>`, for any lifetime `'0`...
   = note: ...but `Deserialize<'1>` is actually implemented for the type `Response<'1, ()>`, for some specific lifetime `'1`

error: could not compile `rpc_` due to previous error
```</div>
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