penumbra_sdk_sct/
params.rs1use penumbra_sdk_proto::penumbra::core::component::sct::v1 as pb;
2use penumbra_sdk_proto::DomainType;
3use serde::{Deserialize, Serialize};
4
5#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
6#[serde(try_from = "pb::SctParameters", into = "pb::SctParameters")]
7pub struct SctParameters {
9 pub epoch_duration: u64,
13}
14
15impl DomainType for SctParameters {
16 type Proto = pb::SctParameters;
17}
18
19impl TryFrom<pb::SctParameters> for SctParameters {
20 type Error = anyhow::Error;
21
22 fn try_from(msg: pb::SctParameters) -> anyhow::Result<Self> {
23 Ok(SctParameters {
24 epoch_duration: msg.epoch_duration,
25 })
26 }
27}
28
29impl From<SctParameters> for pb::SctParameters {
30 fn from(params: SctParameters) -> Self {
31 pb::SctParameters {
32 epoch_duration: params.epoch_duration,
33 }
34 }
35}
36
37impl Default for SctParameters {
38 fn default() -> Self {
39 Self {
40 epoch_duration: 17280,
43 }
44 }
45}