use newton_prover_core::config::{key::EcdsaKey, ConfigLoader};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct AggregatorConfig {
pub ip_address: String,
pub signer: EcdsaKey,
#[serde(default = "default_aggregation_timeout_secs")]
pub aggregation_timeout_secs: u64,
}
fn default_aggregation_timeout_secs() -> u64 {
5
}
impl ConfigLoader for AggregatorConfig {
const FILE_NAME: &'static str = "aggregator";
const ENV_PREFIX: &'static str = "AGGREGATOR";
}
impl AggregatorConfig {
pub fn set_ip_address(&mut self, ip_address: String) {
self.ip_address = ip_address;
}
pub fn set_signer(&mut self, signer: EcdsaKey) {
self.signer = signer;
}
}