tendermint_rpc/endpoint/
commit.rs1use serde::{Deserialize, Serialize};
4use tendermint::{block, block::signed_header::SignedHeader};
5
6use crate::{dialect::Dialect, request::RequestMessage};
7
8#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
10pub struct Request {
11 pub height: Option<block::Height>,
12}
13
14impl Request {
15 pub fn new(height: block::Height) -> Self {
17 Self {
18 height: Some(height),
19 }
20 }
21}
22
23impl RequestMessage for Request {
24 fn method(&self) -> crate::Method {
25 crate::Method::Commit
26 }
27}
28
29impl<S: Dialect> crate::Request<S> for Request {
30 type Response = Response;
31}
32
33impl<S: Dialect> crate::SimpleRequest<S> for Request {
34 type Output = Response;
35}
36
37#[derive(Clone, Debug, Deserialize, Serialize)]
39pub struct Response {
40 pub signed_header: SignedHeader,
42
43 pub canonical: bool,
45}
46
47impl crate::Response for Response {}