Skip to content

Commit

Permalink
fix: the system.args not restored correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbillw committed Feb 6, 2024
1 parent 2333c22 commit a958849
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions crates/cestory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use serde::{
Deserialize, Deserializer, Serialize, Serializer,
};

use crate::{light_validation::LightValidation, system::System};
use crate::light_validation::LightValidation;
use anyhow::{anyhow, Context as _, Result};
use ces_crypto::{
aead,
Expand Down Expand Up @@ -314,6 +314,7 @@ impl<Platform: pal::Platform> Ceseal<Platform> {
if let Some(system) = &mut self.system {
system.sealing_path = self.args.sealing_path.clone();
system.storage_path = self.args.storage_path.clone();
system.args = self.args.clone();
}
}

Expand Down Expand Up @@ -599,14 +600,11 @@ impl<Platform: Serialize + DeserializeOwned> Ceseal<Platform> {
let recv_mq = &mut runtime_state.recv_mq;
let send_mq = &mut runtime_state.send_mq;
let seq = &mut seq;
let mut system: System<Platform> =
ces_mq::checkpoint_helper::using_dispatcher(recv_mq, move || {
ces_mq::checkpoint_helper::using_send_mq(send_mq, || {
seq.next_element()?.ok_or_else(|| de::Error::custom("Missing System"))
})
})?;
system.args = factory.args.clone();
Some(system)
ces_mq::checkpoint_helper::using_dispatcher(recv_mq, move || {
ces_mq::checkpoint_helper::using_send_mq(send_mq, || {
seq.next_element()?.ok_or_else(|| de::Error::custom("Missing System"))
})
})?
};
} else {
let _: Option<serde::de::IgnoredAny> = seq.next_element()?;
Expand Down

0 comments on commit a958849

Please sign in to comment.