Skip to content

Commit cdc2e9b

Browse files
nits
1 parent 4891e04 commit cdc2e9b

2 files changed

Lines changed: 18 additions & 13 deletions

File tree

storage/src/qmdb/current/ordered/db.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,15 @@ where
139139
proof: &KeyValueProof<F, K, H::Digest, N>,
140140
root: &H::Digest,
141141
) -> bool {
142-
let update = Update {
143-
key,
144-
value,
145-
next_key: proof.next_key.clone(),
146-
};
147-
148-
proof.verify_operation(hasher, Operation::Update(update), root)
142+
proof.verify_operation(
143+
hasher,
144+
Operation::Update(Update {
145+
key,
146+
value,
147+
next_key: proof.next_key.clone(),
148+
}),
149+
root,
150+
)
149151
}
150152

151153
/// Get the operation that currently defines the span whose range contains `key`, or None if the

storage/src/qmdb/current/ordered/mod.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,15 @@ pub mod tests {
627627
assert!(TestDb::<F, C, V>::verify_key_value_proof(
628628
&hasher, key, value, &proof, &root
629629
));
630-
let update = Update {
631-
key,
632-
value,
633-
next_key: proof.next_key,
634-
};
635-
assert!(proof.verify_operation(&hasher, Operation::Update(update.clone()), &root));
630+
assert!(proof.verify_operation(
631+
&hasher,
632+
Operation::Update(Update {
633+
key,
634+
value,
635+
next_key: proof.next_key,
636+
}),
637+
&root
638+
));
636639
assert!(!proof.verify_operation(&hasher, Operation::Delete(key), &root));
637640
// Proof should fail against the wrong value. Use hash instead of fill to ensure
638641
// the value differs from any key/value created by TestKey::from_seed (which uses

0 commit comments

Comments
 (0)