Skip to main content

mithril_client/
type_alias.rs

1/// Mithril result type, an alias of [anyhow::Result]
2pub type MithrilResult<T> = anyhow::Result<T>;
3
4/// Mithril error type, an alias of [anyhow::Error]
5pub type MithrilError = anyhow::Error;
6
7/// A Mithril snapshot of a Cardano Node database.
8///
9pub use mithril_common::messages::SnapshotMessage as Snapshot;
10
11/// List item of Mithril snapshots
12///
13pub use mithril_common::messages::SnapshotListItemMessage as SnapshotListItem;
14
15/// A Cardano node database snapshot
16///
17pub use mithril_common::messages::CardanoDatabaseSnapshotMessage as CardanoDatabaseSnapshot;
18
19/// List items of Cardano node database snapshot
20///
21pub use mithril_common::messages::CardanoDatabaseSnapshotListItemMessage as CardanoDatabaseSnapshotListItem;
22
23/// A Mithril stake distribution.
24///
25pub use mithril_common::messages::MithrilStakeDistributionMessage as MithrilStakeDistribution;
26
27/// List item of Mithril stake distributions.
28///
29pub use mithril_common::messages::MithrilStakeDistributionListItemMessage as MithrilStakeDistributionListItem;
30
31/// A Mithril certificate.
32///
33pub use mithril_common::messages::CertificateMessage as MithrilCertificate;
34
35pub use mithril_common::messages::CertificateMetadataMessagePart as MithrilCertificateMetadata;
36
37/// List item of Mithril certificates
38///
39pub use mithril_common::messages::CertificateListItemMessage as MithrilCertificateListItem;
40
41pub use mithril_common::messages::CertificateListItemMessageMetadata as MithrilCertificateListItemMetadata;
42
43/// An individual signer of a [Mithril certificate][MithrilCertificate]
44///
45pub use mithril_common::messages::SignerWithStakeMessagePart as MithrilSigner;
46
47pub use mithril_common::messages::CardanoTransactionsProofsMessage as CardanoTransactionsProofs;
48
49pub use mithril_common::messages::CardanoTransactionsSetProofMessagePart as CardanoTransactionsSetProof;
50
51cfg_unstable! {
52    pub use mithril_common::messages::CardanoTransactionsProofsV2Message as CardanoTransactionsProofsV2;
53
54    pub use mithril_common::messages::CardanoBlocksProofsMessage as CardanoBlocksProofs;
55
56    pub use mithril_common::messages::MkSetProofMessagePart as MkSetProof;
57
58    pub use mithril_common::messages::CardanoBlockMessagePart as CardanoBlock;
59
60    pub use mithril_common::messages::CardanoTransactionMessagePart as CardanoTransaction;
61
62    pub use mithril_common::messages::VerifiedCardanoTransactionsV2;
63
64    pub use mithril_common::messages::VerifiedCardanoBlocks;
65
66    pub use mithril_common::messages::VerifyProofsV2Error;
67
68    pub use mithril_common::messages::CardanoBlocksTransactionsSnapshotMessage as CardanoBlocksTransactionsSnapshot;
69
70    pub use mithril_common::messages::CardanoBlocksTransactionsSnapshotListItemMessage as CardanoBlocksTransactionsSnapshotListItem;
71}
72
73pub use mithril_common::messages::VerifiedCardanoTransactions;
74
75pub use mithril_common::messages::VerifyCardanoTransactionsProofsError;
76
77/// A snapshot that allow to know up to which [point of time][common::CardanoDbBeacon] Mithril have certified Cardano transactions.
78pub use mithril_common::messages::CardanoTransactionSnapshotMessage as CardanoTransactionSnapshot;
79
80/// List item of a Cardano transaction snapshot.
81pub use mithril_common::messages::CardanoTransactionSnapshotListItemMessage as CardanoTransactionSnapshotListItem;
82
83/// A Cardano stake distribution.
84pub use mithril_common::messages::CardanoStakeDistributionMessage as CardanoStakeDistribution;
85
86/// List item of Cardano stake distributions.
87pub use mithril_common::messages::CardanoStakeDistributionListItemMessage as CardanoStakeDistributionListItem;
88
89/// `mithril-common` re-exports
90pub mod common {
91    pub use mithril_common::AggregateSignatureType;
92    pub use mithril_common::crypto_helper::MKProof;
93    pub use mithril_common::entities::{
94        AncillaryLocation, BlockHash, BlockNumber, BlockNumberOffset, CardanoDbBeacon,
95        CardanoNetwork, ChainPoint, CompressionAlgorithm, DigestLocation, Epoch, EpochSpecifier,
96        ImmutableFileNumber, ImmutablesLocation, MagicId, MithrilNetwork, MultiFilesUri,
97        ProtocolMessage, ProtocolMessagePartKey, ProtocolParameters, SignedEntityType,
98        SignedEntityTypeDiscriminants, SlotNumber, StakeDistribution, SupportedEra, TemplateUri,
99        TransactionHash,
100    };
101    pub use mithril_common::messages::{
102        AncillaryMessagePart, DigestsMessagePart, ImmutablesMessagePart,
103    };
104
105    /// Test utilities.
106    ///
107    /// ⚠ Do not use in production code ⚠
108    pub mod test {
109        pub use mithril_common::test::double::Dummy;
110    }
111}
112
113/// Required capabilities for an aggregator.
114#[cfg(not(target_family = "wasm"))]
115pub use mithril_aggregator_discovery::RequiredAggregatorCapabilities;