Skip to content

Commit b91f688

Browse files
authored
Merge pull request #47 from Foundation-Devices/add-hash-to-backup-protocol
add hash to backup protocl and remove downloading event
2 parents c27be2b + f65a9b3 commit b91f688

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

api/src/api/backup.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,16 @@ pub enum CreateMagicBackupEvent {
7878
Chunk(#[n(0)] BackupChunk),
7979
}
8080

81+
type Sha256Hash = [u8; 32];
82+
8183
#[quantum_link]
8284
pub struct StartMagicBackup {
8385
#[n(0)]
8486
pub seed_fingerprint: SeedFingerprint,
8587
#[n(1)]
8688
pub total_chunks: u32,
89+
#[n(2)]
90+
pub hash: Sha256Hash,
8791
}
8892

8993
// envoy -> prime
@@ -118,13 +122,11 @@ pub enum RestoreMagicBackupEvent {
118122
// envoy found a backup and is beginning transmission
119123
#[n(1)]
120124
Starting(#[n(0)] BackupMetadata),
121-
// envoy is downloading the backup
125+
// a backup chunk
122126
#[n(2)]
123-
Downloading,
124-
#[n(3)]
125127
Chunk(#[n(0)] BackupChunk),
126128
// envoy failed
127-
#[n(5)]
129+
#[n(3)]
128130
Error(#[n(0)] String),
129131
}
130132

0 commit comments

Comments
 (0)