Skip to content

Commit 7fed014

Browse files
committed
Add meta.json to the task dump archive
1 parent 87fb929 commit 7fed014

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

gateway-sp-comms/src/single_sp.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,27 @@ pub struct TaskDump {
214214
}
215215

216216
impl TaskDump {
217+
/// Writes the task dump to a ZIP file
217218
pub fn write_zip<W: Write + Seek>(
218219
&self,
219220
out: W,
220221
) -> Result<(), std::io::Error> {
221222
let mut z = zip::ZipWriter::new(out);
222223
let opt = zip::write::FileOptions::default();
223224

225+
// Store metadata about the dump format itself in `meta.json`
226+
//
227+
// This version number is checked by Humility; remember to update it if
228+
// you're changing the archive in breaking ways.
229+
z.start_file("meta.json", opt)?;
230+
write!(
231+
z,
232+
r#"\
233+
{{
234+
"version": 1,
235+
}}"#
236+
)?;
237+
224238
z.start_file("TASK_INDEX", opt)?;
225239
writeln!(z, "{}", self.task_index)?;
226240
z.start_file("TIMESTAMP", opt)?;

0 commit comments

Comments
 (0)