mithril-common 0.6.67

Common types, interfaces, and utilities for Mithril nodes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::collections::BTreeMap;

use serde::{Deserialize, Serialize};

use crate::crypto_helper::ManifestSignature;

/// Stores a map of files and their hashes, with an optional signature to verify the integrity of the
/// signed data.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SignableManifest<TKey: Ord, TValue> {
    /// The data stored in the manifest
    pub data: BTreeMap<TKey, TValue>,
    /// The signature of the manifest
    #[serde(skip_serializing_if = "Option::is_none")]
    pub signature: Option<ManifestSignature>,
}