From 73d05f008ea55d82a6993d09afec418a45fb5c9b Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 26 Mar 2024 12:11:37 +0000 Subject: [PATCH] fmt fix --- .../src/e2e_cross_chain_messaging.test.ts | 1 - .../end-to-end/src/e2e_outbox.test.ts | 16 +++++----- .../e2e_public_cross_chain_messaging.test.ts | 1 - .../src/shared/cross_chain_test_harness.ts | 30 ++++++++----------- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts b/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts index 57d02f6cccad..52bfa8b5b06b 100644 --- a/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts +++ b/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts @@ -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'; diff --git a/yarn-project/end-to-end/src/e2e_outbox.test.ts b/yarn-project/end-to-end/src/e2e_outbox.test.ts index 071c4d882ae3..e94ecec0cd56 100644 --- a/yarn-project/end-to-end/src/e2e_outbox.test.ts +++ b/yarn-project/end-to-end/src/e2e_outbox.test.ts @@ -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; } diff --git a/yarn-project/end-to-end/src/e2e_public_cross_chain_messaging.test.ts b/yarn-project/end-to-end/src/e2e_public_cross_chain_messaging.test.ts index 93cb2c56bc43..740fb2a5c991 100644 --- a/yarn-project/end-to-end/src/e2e_public_cross_chain_messaging.test.ts +++ b/yarn-project/end-to-end/src/e2e_public_cross_chain_messaging.test.ts @@ -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'; diff --git a/yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts b/yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts index 887aef53d3b2..89f8778ae5f6 100644 --- a/yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts +++ b/yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts @@ -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; }