Skip to content

Commit

Permalink
fix wrong equality constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Aug 23, 2024
1 parent 2d6223b commit 4f67465
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/sozo/src/commands/options/account/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ where
}

// Check if the new policies are equal to the ones in the existing session
//
// This function would compute the merkle root of the new policies and compare it with the root in
// the existing SessionMetadata.
fn is_equal_to_existing(new_policies: &[Policy], session: &SessionMetadata) -> bool {
let allowed_methods = new_policies
.iter()
Expand All @@ -145,7 +148,7 @@ fn is_equal_to_existing(new_policies: &[Policy], session: &SessionMetadata) -> b

let root = MerkleTree::compute_root(hashes[0], allowed_methods[0].proof.clone());

root != session.session.allowed_methods_root
root == session.session.allowed_methods_root
}

/// Policies are the building block of a session key. It's what defines what methods are allowed for
Expand Down

0 comments on commit 4f67465

Please sign in to comment.