tendermint/abci/response/
prepare_proposal.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use bytes::Bytes;

use crate::prelude::*;

#[doc = include_str!("../doc/response-prepareproposal.md")]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PrepareProposal {
    pub txs: Vec<Bytes>,
}

// =============================================================================
// Protobuf conversions
// =============================================================================

mod v0_37 {
    use super::PrepareProposal;
    use tendermint_proto::v0_37::abci as pb;
    use tendermint_proto::Protobuf;

    impl From<PrepareProposal> for pb::ResponsePrepareProposal {
        fn from(value: PrepareProposal) -> Self {
            Self { txs: value.txs }
        }
    }

    impl TryFrom<pb::ResponsePrepareProposal> for PrepareProposal {
        type Error = crate::Error;

        fn try_from(message: pb::ResponsePrepareProposal) -> Result<Self, Self::Error> {
            Ok(Self { txs: message.txs })
        }
    }

    impl Protobuf<pb::ResponsePrepareProposal> for PrepareProposal {}
}

mod v0_38 {
    use super::PrepareProposal;
    use tendermint_proto::v0_38::abci as pb;
    use tendermint_proto::Protobuf;

    impl From<PrepareProposal> for pb::ResponsePrepareProposal {
        fn from(value: PrepareProposal) -> Self {
            Self { txs: value.txs }
        }
    }

    impl TryFrom<pb::ResponsePrepareProposal> for PrepareProposal {
        type Error = crate::Error;

        fn try_from(message: pb::ResponsePrepareProposal) -> Result<Self, Self::Error> {
            Ok(Self { txs: message.txs })
        }
    }

    impl Protobuf<pb::ResponsePrepareProposal> for PrepareProposal {}
}