tendermint/abci/request/
set_option.rs

1use crate::prelude::*;
2
3#[doc = include_str!("../doc/request-setoption.md")]
4#[derive(Clone, PartialEq, Eq, Debug)]
5pub struct SetOption {
6    pub key: String,
7    pub value: String,
8}
9
10// =============================================================================
11// Protobuf conversions
12// =============================================================================
13
14// The SetOption request has been removed after 0.34.
15
16use tendermint_proto::v0_34::abci as pb;
17use tendermint_proto::Protobuf;
18
19impl From<SetOption> for pb::RequestSetOption {
20    fn from(message: SetOption) -> Self {
21        Self {
22            key: message.key,
23            value: message.value,
24        }
25    }
26}
27
28impl TryFrom<pb::RequestSetOption> for SetOption {
29    type Error = crate::Error;
30
31    fn try_from(message: pb::RequestSetOption) -> Result<Self, Self::Error> {
32        Ok(Self {
33            key: message.key,
34            value: message.value,
35        })
36    }
37}
38
39impl Protobuf<pb::RequestSetOption> for SetOption {}