Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Feb 21, 2024
1 parent 5702055 commit aac7c16
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`FunctionSelector computes a function selector from signature 1`] = `
FunctionSelector {
"value": 2835717307,
}
`;
4 changes: 2 additions & 2 deletions yarn-project/foundation/src/crypto/pedersen/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ describe('pedersen', () => {

it('pedersen hash', () => {
const r = pedersenHash([toBufferBE(1n, 32), toBufferBE(1n, 32)]);
expect(r).toEqual(Buffer.from('07ebfbf4df29888c6cd6dca13d4bb9d1a923013ddbbcbdc3378ab8845463297b', 'hex'));
expect(r.toString()).toEqual('0x07ebfbf4df29888c6cd6dca13d4bb9d1a923013ddbbcbdc3378ab8845463297b');
});

it('pedersen hash with index', () => {
const r = pedersenHash([toBufferBE(1n, 32), toBufferBE(1n, 32)], 5);
expect(r).toEqual(Buffer.from('1c446df60816b897cda124524e6b03f36df0cec333fad87617aab70d7861daa6', 'hex'));
expect(r.toString()).toEqual('0x1c446df60816b897cda124524e6b03f36df0cec333fad87617aab70d7861daa6');
});

it('pedersen hash buffer', () => {
Expand Down
1 change: 0 additions & 1 deletion yarn-project/simulator/src/avm/opcodes/hashing.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
import { keccak, pedersenHash, poseidonHash, sha256 } from '@aztec/foundation/crypto';

import { AvmContext } from '../avm_context.js';
Expand Down
5 changes: 1 addition & 4 deletions yarn-project/simulator/src/public/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,7 @@ describe('ACIR public execution simulator', () => {
// Assert the l2 to l1 message was created
expect(result.newL2ToL1Messages.length).toEqual(1);

const expectedNewMessage = new L2ToL1Message(
portalContractAddress,
pedersenHash(params.map(a => a.toBuffer())),
);
const expectedNewMessage = new L2ToL1Message(portalContractAddress, pedersenHash(params.map(a => a.toBuffer())));

expect(result.newL2ToL1Messages[0]).toEqual(expectedNewMessage);
});
Expand Down

0 comments on commit aac7c16

Please sign in to comment.