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
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use tendermint::{chain, net};
#[derive(Clone, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct ValidatorConfig {
pub addr: net::Address,
pub chain_id: chain::Id,
#[serde(default = "reconnect_default")]
pub reconnect: bool,
pub timeout: Option<u16>,
pub secret_key: Option<PathBuf>,
pub max_height: Option<tendermint::block::Height>,
#[serde(default = "protocol_default")]
pub protocol_version: TendermintVersion,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub enum TendermintVersion {
#[serde(rename = "legacy")]
Legacy,
#[serde(rename = "v0.33")]
V0_33,
}
fn reconnect_default() -> bool {
true
}
fn protocol_default() -> TendermintVersion {
TendermintVersion::Legacy
}