Skip to content

Commit

Permalink
fmt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Mar 26, 2024
1 parent 84f74e2 commit 73d05f0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
computeAuthWitMessageHash,
} from '@aztec/aztec.js';
import { sha256ToField } from '@aztec/foundation/crypto';
import { serializeToBuffer } from '@aztec/foundation/serialize';
import { TokenBridgeContract, TokenContract } from '@aztec/noir-contracts.js';

import { toFunctionSelector } from 'viem/utils';
Expand Down
16 changes: 7 additions & 9 deletions yarn-project/end-to-end/src/e2e_outbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,13 @@ describe('E2E Outbox Tests', () => {
}

function makeL2ToL1Message(recipient: EthAddress, content: Fr = Fr.ZERO): Fr {
const leaf = sha256ToField(
[
contract.address,
new Fr(1), // aztec version
recipient.toBuffer32(),
new Fr(deployL1ContractsValues.publicClient.chain.id), // chain id
content,
]
);
const leaf = sha256ToField([
contract.address,
new Fr(1), // aztec version
recipient.toBuffer32(),
new Fr(deployL1ContractsValues.publicClient.chain.id), // chain id
content,
]);

return leaf;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
computeMessageSecretHash,
} from '@aztec/aztec.js';
import { sha256ToField } from '@aztec/foundation/crypto';
import { serializeToBuffer } from '@aztec/foundation/serialize';
import { InboxAbi, OutboxAbi } from '@aztec/l1-artifacts';
import { TestContract } from '@aztec/noir-contracts.js';
import { TokenContract } from '@aztec/noir-contracts.js/Token';
Expand Down
30 changes: 13 additions & 17 deletions yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,23 +363,19 @@ export class CrossChainTestHarness {
}

getL2ToL1MessageLeaf(withdrawAmount: bigint, callerOnL1: EthAddress = EthAddress.ZERO): Fr {
const content = sha256ToField(
[
Buffer.from(toFunctionSelector('withdraw(address,uint256,address)').substring(2), 'hex'),
this.ethAccount.toBuffer32(),
new Fr(withdrawAmount).toBuffer(),
callerOnL1.toBuffer32(),
]
);
const leaf = sha256ToField(
[
this.l2Bridge.address.toBuffer(),
new Fr(1).toBuffer(), // aztec version
this.tokenPortalAddress.toBuffer32() ?? Buffer.alloc(32, 0),
new Fr(this.publicClient.chain.id).toBuffer(), // chain id
content.toBuffer(),
]
);
const content = sha256ToField([
Buffer.from(toFunctionSelector('withdraw(address,uint256,address)').substring(2), 'hex'),
this.ethAccount.toBuffer32(),
new Fr(withdrawAmount).toBuffer(),
callerOnL1.toBuffer32(),
]);
const leaf = sha256ToField([
this.l2Bridge.address.toBuffer(),
new Fr(1).toBuffer(), // aztec version
this.tokenPortalAddress.toBuffer32() ?? Buffer.alloc(32, 0),
new Fr(this.publicClient.chain.id).toBuffer(), // chain id
content.toBuffer(),
]);

return leaf;
}
Expand Down

0 comments on commit 73d05f0

Please sign in to comment.