use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EscrowMetadata {
pub escrowed_at: DateTime<Utc>,
pub escrowed_by: String,
pub key_id: String,
pub key_type: String,
pub custodian_count: u32,
pub threshold: u32,
#[serde(default)]
pub description: Option<String>,
}
impl EscrowMetadata {
pub fn new(
escrowed_by: impl Into<String>,
key_id: impl Into<String>,
key_type: impl Into<String>,
custodian_count: u32,
threshold: u32,
) -> Self {
Self {
escrowed_at: Utc::now(),
escrowed_by: escrowed_by.into(),
key_id: key_id.into(),
key_type: key_type.into(),
custodian_count,
threshold,
description: None,
}
}
}