mithril_common/
lib.rs

1#![warn(missing_docs)]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3
4//! Shared datatypes and traits used by Mithril rust projects
5//!
6//! Provide:
7//! - Helpers for the [Mithril STM](https://mithril.network/rust-doc/mithril_stm/index.html)
8//!   lib with the [crypto_helper].
9//! - [certificate chain][certificate_chain] used to validate the Certificate Chain created by an aggregator
10//! - The [entities] used by, and exchanged between, the aggregator, signers and client.
11
12pub mod api_version;
13pub mod certificate_chain;
14pub mod crypto_helper;
15pub mod entities;
16pub mod logging;
17pub mod messages;
18pub mod protocol;
19pub mod signable_builder;
20
21pub mod test;
22
23pub use entities::{CardanoNetwork, MagicId};
24
25pub use mithril_stm::AggregateSignatureType;
26
27/// Generic error type
28pub type StdError = anyhow::Error;
29
30/// Generic result type
31pub type StdResult<T> = anyhow::Result<T, StdError>;
32
33/// Mithril API protocol version header name
34pub const MITHRIL_API_VERSION_HEADER: &str = "mithril-api-version";
35
36/// Mithril signer node version header name
37pub const MITHRIL_SIGNER_VERSION_HEADER: &str = "signer-node-version";
38
39/// Mithril aggregator node version header name
40pub const MITHRIL_AGGREGATOR_VERSION_HEADER: &str = "aggregator-node-version";
41
42/// Mithril origin of the request
43pub const MITHRIL_ORIGIN_TAG_HEADER: &str = "mithril-origin-tag";
44
45/// Mithril client type of the request
46pub const MITHRIL_CLIENT_TYPE_HEADER: &str = "mithril-client-type";
47
48/// Macro used to mark the code that should be cleaned up when the new era is activated
49#[macro_export]
50macro_rules! era_deprecate {
51    ( $comment:literal ) => {};
52}