DustCloudBackupCoordinator

DustCloudBackup over an injected BackupStorage (Drive in production) + a pre-derived AES key (com.midnight.kuira.core.identity.backup.SeedDerivedKeyDeriver).

The Drive/auth specifics live in the Hilt wiring; this class is pure logic — encrypt/decrypt, the versioned multi-network bundle merge, and the content-hash upload guard — so it's fully JVM-unit-testable with a fake storage + digest store.

Every operation is failure-tolerant by contract: fetch returns null on any problem (→ caller falls back to genesis), and upload is invoked best-effort (callers wrap it in runCatching).

Constructors

Link copied to clipboard
constructor(storage: BackupStorage, encryptionKey: ByteArray, digestStore: DustBackupDigestStore)

Functions

Link copied to clipboard
open suspend override fun fetch(address: String): RestoredDustCheckpoint?
Link copied to clipboard
open suspend override fun upload(address: String, stateBytes: ByteArray, lastEventId: Long)