mithril_common/crypto_helper/types/
alias.rs

1use crate::crypto_helper::cardano::{
2    KeyRegWrapper, ProtocolInitializerErrorWrapper, ProtocolRegistrationErrorWrapper,
3    StmInitializerWrapper,
4};
5
6use mithril_stm::{
7    AggregationError, Clerk, ClosedKeyRegistration, Index, MithrilMembershipDigest, Parameters,
8    Signer, Stake,
9};
10
11/// A protocol version
12pub type ProtocolVersion<'a> = &'a str;
13
14// Protocol types alias
15pub(crate) type D = MithrilMembershipDigest;
16
17/// The id of a mithril party.
18pub type ProtocolPartyId = String;
19
20/// Alias of [MithrilStm:Stake](type@mithril_stm::Stake).
21pub type ProtocolStake = Stake;
22
23/// A list of [Party Id][ProtocolPartyId] associated with its [Stake][ProtocolStake].
24pub type ProtocolStakeDistribution = Vec<(ProtocolPartyId, ProtocolStake)>;
25
26/// Alias of [MithrilStm::Parameters](struct@mithril_stm::Parameters).
27pub type ProtocolParameters = Parameters;
28
29/// Alias of [MithrilStm::Index](type@mithril_stm::Index).
30pub type ProtocolLotteryIndex = Index;
31
32/// Alias of [MithrilStm:Signer](struct@mithril_stm::Signer).
33pub type ProtocolSigner = Signer<D>;
34
35/// Alias of a wrapper of [MithrilStm:Initializer](struct@mithril_stm::Initializer).
36pub type ProtocolInitializer = StmInitializerWrapper;
37
38/// Alias of [MithrilStm:Clerk](struct@mithril_stm::Clerk).
39pub type ProtocolClerk = Clerk<D>;
40
41/// Alias of a wrapper of [MithrilStm:KeyRegistration](struct@mithril_stm::KeyRegistration).
42pub type ProtocolKeyRegistration = KeyRegWrapper;
43
44/// Alias of a wrapper of [MithrilStm:ClosedKeyRegistration](struct@mithril_stm::ClosedKeyRegistration).
45pub type ProtocolClosedKeyRegistration = ClosedKeyRegistration<D>;
46
47// Error alias
48/// Alias of a wrapper of [MithrilCommon:ProtocolRegistrationErrorWrapper](enum@ProtocolRegistrationErrorWrapper).
49pub type ProtocolRegistrationError = ProtocolRegistrationErrorWrapper;
50
51/// Alias of a wrapper of [MithrilCommon:ProtocolInitializerErrorWrapper](enum@ProtocolInitializerErrorWrapper).
52pub type ProtocolInitializerError = ProtocolInitializerErrorWrapper;
53
54/// Alias of [MithrilStm:AggregationError](enum@mithril_stm::AggregationError).
55pub type ProtocolAggregationError = AggregationError;