tendermint/public_key/
pub_key_response.rs1use crate::{privval::RemoteSignerError, PublicKey};
2
3#[derive(Clone, PartialEq, Eq, Debug)]
5pub struct PubKeyResponse {
7 pub pub_key: Option<PublicKey>,
9
10 pub error: Option<RemoteSignerError>,
12}
13
14tendermint_pb_modules! {
19 use super::PubKeyResponse;
20 use pb::privval::PubKeyResponse as RawPubKeyResponse;
21
22 impl Protobuf<RawPubKeyResponse> for PubKeyResponse {}
23
24 impl TryFrom<RawPubKeyResponse> for PubKeyResponse {
25 type Error = crate::Error;
26
27 fn try_from(value: RawPubKeyResponse) -> Result<Self, Self::Error> {
28 Ok(PubKeyResponse {
29 pub_key: value.pub_key.map(TryInto::try_into).transpose()?,
30 error: value.error.map(TryInto::try_into).transpose()?,
31 })
32 }
33 }
34
35 impl From<PubKeyResponse> for RawPubKeyResponse {
36 fn from(value: PubKeyResponse) -> Self {
37 RawPubKeyResponse {
38 pub_key: value.pub_key.map(Into::into),
39 error: value.error.map(Into::into),
40 }
41 }
42 }
43}
44