Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding check on key by accepting Fr
Browse files Browse the repository at this point in the history
benesjan committed Feb 8, 2024
1 parent 3bde7dd commit 21d29b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yarn-project/simulator/src/utils.ts
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@ import { Fr } from '@aztec/foundation/fields';
export function computeSlotForMapping(
mappingSlot: Fr,
key: {
/** Serialize to a buffer. */
toBuffer: () => Buffer;
/** Serialize to a field. */
toField: () => Fr;
},
) {
return Fr.fromBuffer(pedersenHash([mappingSlot.toBuffer(), key.toBuffer()]));
return Fr.fromBuffer(pedersenHash([mappingSlot, key.toField()].map(field => field.toBuffer())));
}

0 comments on commit 21d29b6

Please sign in to comment.