diff --git a/src/process.rs b/src/process.rs index 5aecad4..60487f1 100644 --- a/src/process.rs +++ b/src/process.rs @@ -137,53 +137,24 @@ impl ProcessState { } /// A process is basically a succession of states -/// If a process has nothing to do with us, shared_secrets and impending_requests will be empty +/// If a process has nothing to do with us, impending_requests will be empty #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct Process { states: Vec, - shared_secrets: HashMap, impending_requests: Vec, } impl Process { pub fn new( states: Vec, - shared_secrets: HashMap, impending_requests: Vec, ) -> Self { Self { states, - shared_secrets: shared_secrets - .into_iter() - .map(|(k, v)| (k.to_string(), v)) - .collect(), impending_requests, } } - pub fn insert_shared_secret( - &mut self, - address: SilentPaymentAddress, - secret: AnkSharedSecretHash, - ) { - self.shared_secrets.insert(address.to_string(), secret); - } - - pub fn get_shared_secret_for_address( - &self, - address: &SilentPaymentAddress, - ) -> Option { - self.shared_secrets.get(&address.to_string()).cloned() - } - - pub fn get_all_secrets(&self) -> HashMap { - self.shared_secrets - .clone() - .into_iter() - .map(|(k, v)| (SilentPaymentAddress::try_from(k.as_str()).unwrap(), v)) - .collect() - } - pub fn insert_state(&mut self, state: ProcessState) { self.states.push(state); }