Skip to content

Commit

Permalink
chore: add deprecation note for get_tree_key_hash methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Feb 17, 2024
1 parent 5df627a commit 244fc0f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ffi_interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub enum Error {
ProofVerificationFailed,
}

#[allow(deprecated)]
#[deprecated(note = "moving forward one should implement this method on the caller side")]
/// Compute the key prefix used in the `get_tree_key` method
///
/// Returns a 32 byte slice representing the first 31 bytes of the `key` to be used in `get_tree_key`
Expand All @@ -88,6 +90,8 @@ pub fn get_tree_key_hash(

get_tree_key_hash_flat_input(context, input)
}

#[deprecated(note = "moving forward one should implement this method on the caller side")]
/// Same method as `get_tree_key_hash` but takes a 64 byte input instead of two 32 byte inputs
///
/// This is kept for backwards compatibility and because we have not yet checked if its better
Expand All @@ -97,6 +101,9 @@ pub fn get_tree_key_hash(
pub fn get_tree_key_hash_flat_input(context: &Context, input: [u8; 64]) -> [u8; 32] {
verkle_spec::hash64(&context.committer, input).to_fixed_bytes()
}

#[allow(deprecated)]
#[deprecated(note = "moving forward one should implement this method on the caller side")]
pub fn get_tree_key(
context: &Context,
address: [u8; 32],
Expand All @@ -110,6 +117,8 @@ pub fn get_tree_key(
hash
}

#[allow(deprecated)]
#[deprecated(note = "moving forward one should implement this method on the caller side")]
/// This is exactly the same as `get_tree_key_hash` method.
/// Use get_tree_key_hash instead.
///
Expand Down Expand Up @@ -647,7 +656,7 @@ fn check_identity_constant() {
let identity_bytes = identity.to_bytes_uncompressed();
assert_eq!(identity_bytes, ZERO_POINT);
}

#[allow(deprecated)]
#[cfg(test)]
mod pedersen_hash_tests {

Expand Down

0 comments on commit 244fc0f

Please sign in to comment.