mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-12 00:51:29 +01:00
refactor: remove obsolete traits
This commit is contained in:
committed by
Bobbin Threadbare
parent
8ea37904e3
commit
a933ff2fa0
@@ -1,6 +1,5 @@
|
||||
use crate::{
|
||||
merkle::{EmptySubtreeRoots, InnerNodeInfo, MerkleTreeDelta, StoreNode, ValuePath},
|
||||
utils::collections::TryApplyDiff,
|
||||
merkle::{EmptySubtreeRoots, InnerNodeInfo, ValuePath},
|
||||
EMPTY_WORD,
|
||||
};
|
||||
|
||||
@@ -300,26 +299,3 @@ impl<const DEPTH: u8> SparseMerkleTree<DEPTH> for SimpleSmt<DEPTH> {
|
||||
*key
|
||||
}
|
||||
}
|
||||
|
||||
// TRY APPLY DIFF
|
||||
// ================================================================================================
|
||||
impl<const DEPTH: u8> TryApplyDiff<RpoDigest, StoreNode> for SimpleSmt<DEPTH> {
|
||||
type Error = MerkleError;
|
||||
type DiffType = MerkleTreeDelta;
|
||||
|
||||
fn try_apply(&mut self, diff: MerkleTreeDelta) -> Result<(), MerkleError> {
|
||||
if diff.depth() != DEPTH {
|
||||
return Err(MerkleError::InvalidDepth { expected: DEPTH, provided: diff.depth() });
|
||||
}
|
||||
|
||||
for slot in diff.cleared_slots() {
|
||||
self.insert(LeafIndex::<DEPTH>::new(*slot)?, Self::EMPTY_VALUE);
|
||||
}
|
||||
|
||||
for (slot, value) in diff.updated_slots() {
|
||||
self.insert(LeafIndex::<DEPTH>::new(*slot)?, *value);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user