Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Apr 30, 2024
1 parent 0e66075 commit 93e70ba
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions grovedb/src/replication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,14 @@ impl GroveDb {
&& state_sync_info.processed_prefixes.is_empty()
{
let root_prefix = [0u8; 32];
if let Ok(merk) = self
.open_merk_for_replication(SubtreePath::empty(), tx) {
if let Ok(merk) = self.open_merk_for_replication(SubtreePath::empty(), tx) {
let restorer = Restorer::new(merk, app_hash, None);
state_sync_info.restorer = Some(restorer);
state_sync_info.current_prefix = Some(root_prefix);
state_sync_info.pending_chunks.insert(root_prefix.to_vec());

res.push(root_prefix.to_vec());
}
else {
} else {
return Err(Error::InternalError("Unable to open merk for replication"));
}
} else {
Expand Down Expand Up @@ -398,8 +396,11 @@ impl GroveDb {
let path: &[&[u8]] = &subtree_path;

if let Ok(merk) = self.open_merk_for_replication(path.into(), tx) {
let restorer =
Restorer::new(merk, *s_elem_value_hash, Some(*s_actual_value_hash));
let restorer = Restorer::new(
merk,
*s_elem_value_hash,
Some(*s_actual_value_hash),
);
state_sync_info.restorer = Some(restorer);
state_sync_info.current_prefix = Some(*prefix);
state_sync_info.num_processed_chunks = 0;
Expand All @@ -409,9 +410,10 @@ impl GroveDb {
.pending_chunks
.insert(root_chunk_prefix.clone());
res.push(root_chunk_prefix);
}
else {
return Err(Error::InternalError("Unable to open merk for replication"));
} else {
return Err(Error::InternalError(
"Unable to open merk for replication",
));
}
break;
}
Expand Down

0 comments on commit 93e70ba

Please sign in to comment.