pub struct JellyfishMerkleRestore<V> { /* private fields */ }
Implementations§
source§impl<V> JellyfishMerkleRestore<V>where
V: Value,
impl<V> JellyfishMerkleRestore<V>where V: Value,
pub fn new<D: 'static + TreeReader<V> + TreeWriter<V>>( store: Arc<D>, version: Version, expected_root_hash: HashValue ) -> Result<Self>
pub fn new_overwrite<D: 'static + TreeWriter<V>>( store: Arc<D>, version: Version, expected_root_hash: HashValue ) -> Result<Self>
sourcepub fn add_chunk(
&mut self,
chunk: Vec<(HashValue, V)>,
proof: SparseMerkleRangeProof
) -> Result<()>
pub fn add_chunk( &mut self, chunk: Vec<(HashValue, V)>, proof: SparseMerkleRangeProof ) -> Result<()>
Restores a chunk of accounts. This function will verify that the given chunk is correct using the proof and root hash, then write things to storage. If the chunk is invalid, an error will be returned and nothing will be written to storage.