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
25/// Generic error type
26pub type StdError = anyhow::Error;
27
28/// Generic result type
29pub type StdResult<T> = anyhow::Result<T, StdError>;
30
31/// Mithril API protocol version header name
32pub const MITHRIL_API_VERSION_HEADER: &str = "mithril-api-version";
33
34/// Mithril signer node version header name
35pub const MITHRIL_SIGNER_VERSION_HEADER: &str = "signer-node-version";
36
37/// Mithril aggregator node version header name
38pub const MITHRIL_AGGREGATOR_VERSION_HEADER: &str = "aggregator-node-version";
39
40/// Mithril origin of the request
41pub const MITHRIL_ORIGIN_TAG_HEADER: &str = "mithril-origin-tag";
42
43/// Mithril client type of the request
44pub const MITHRIL_CLIENT_TYPE_HEADER: &str = "mithril-client-type";
45
46/// Macro used to mark the code that should be cleaned up when the new era is activated
47#[macro_export]
48macro_rules! era_deprecate {
49    ( $comment:literal ) => {};
50}