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

Deserialization fails for Secp256k1Scalar #180

Open
ssantos21 opened this issue Jul 8, 2023 · 0 comments
Open

Deserialization fails for Secp256k1Scalar #180

ssantos21 opened this issue Jul 8, 2023 · 0 comments

Comments

@ssantos21
Copy link

ssantos21 commented Jul 8, 2023

I'm trying to deserialize a String to Secp256k1Scalar, but I am getting the error error[E0277]: the trait bound "Secp256k1Scalar: Deserialize<'_>" is not satisfied, as shown below.

The code is:

let s2: Secp256k1Scalar = serde_json::from_str(&text).unwrap();

How can I deserialize a String to Secp256k1Scalar ?

error[E0277]: the trait bound `Secp256k1Scalar: Deserialize<'_>` is not satisfied
    --> server/src/protocol/ecdsa.rs:134:32
     |
134  |                     Some(s) => serde_json::from_str(&s).unwrap(),
     |                                ^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `Secp256k1Scalar`
     |
     = help: the following other types implement trait `Deserialize<'de>`:
               &'a RawStr
               &'a UncasedStr
               &'a [u8]
               &'a rocket::form::name::Key
               &'a rocket::form::name::Name
               &'a serde_bytes::bytes::Bytes
               &'a std::path::Path
               &'a str
             and 459 others
note: required by a bound in `serde_json::from_str`
    --> /home/node/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.99/src/de.rs:2603:8
     |
2603 |     T: de::Deserialize<'a>,
     |        ^^^^^^^^^^^^^^^^^^^ required by this bound in `from_str`
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