snapshot chunk and restore traits

This commit is contained in:
Robert Habermeier
2017-04-19 20:31:53 +02:00
parent 4d3f137e1e
commit 2ec3397b7d
12 changed files with 446 additions and 327 deletions

View File

@@ -24,7 +24,6 @@ use SyncConfig;
pub struct TestSnapshotService {
manifest: Option<ManifestData>,
chunks: HashMap<H256, Bytes>,
canon_hashes: Mutex<HashMap<u64, H256>>,
restoration_manifest: Mutex<Option<ManifestData>>,
state_restoration_chunks: Mutex<HashMap<H256, Bytes>>,
@@ -36,7 +35,6 @@ impl TestSnapshotService {
TestSnapshotService {
manifest: None,
chunks: HashMap::new(),
canon_hashes: Mutex::new(HashMap::new()),
restoration_manifest: Mutex::new(None),
state_restoration_chunks: Mutex::new(HashMap::new()),
block_restoration_chunks: Mutex::new(HashMap::new()),
@@ -61,7 +59,6 @@ impl TestSnapshotService {
TestSnapshotService {
manifest: Some(manifest),
chunks: chunks,
canon_hashes: Mutex::new(HashMap::new()),
restoration_manifest: Mutex::new(None),
state_restoration_chunks: Mutex::new(HashMap::new()),
block_restoration_chunks: Mutex::new(HashMap::new()),
@@ -115,10 +112,6 @@ impl SnapshotService for TestSnapshotService {
self.block_restoration_chunks.lock().insert(hash, chunk);
}
}
fn provide_canon_hashes(&self, hashes: &[(u64, H256)]) {
self.canon_hashes.lock().extend(hashes.iter().cloned());
}
}
#[test]