Skip to content

Commit

Permalink
feat: re-exposing compute_initialization_hash (#11423)
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan authored Jan 22, 2025
1 parent e74ce15 commit 1ad2b70
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ pub fn assert_initialization_matches_address_preimage_private(context: PrivateCo
);
}

fn compute_initialization_hash(init_selector: FunctionSelector, init_args_hash: Field) -> Field {
/// This function is not only used in macros but it's also used by external people to check that an instance has been
/// initialized with the correct constructor arguments. Don't hide this unless you implement factory functionality.
pub fn compute_initialization_hash(
init_selector: FunctionSelector,
init_args_hash: Field,
) -> Field {
poseidon2_hash_with_separator(
[init_selector.to_field(), init_args_hash],
GENERATOR_INDEX__CONSTRUCTOR,
Expand Down

0 comments on commit 1ad2b70

Please sign in to comment.