From f53a0d149336213240f68c8cd39de96d5d8f4fc0 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 21 Feb 2024 12:02:00 +0000 Subject: [PATCH 1/2] fix: add registry contract to list --- yarn-project/aztec/src/cli/util.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/yarn-project/aztec/src/cli/util.ts b/yarn-project/aztec/src/cli/util.ts index 28417b5217c..9143abbe99a 100644 --- a/yarn-project/aztec/src/cli/util.ts +++ b/yarn-project/aztec/src/cli/util.ts @@ -13,6 +13,7 @@ const l1ContractsNames = [ 'outboxAddress', 'contractDeploymentEmitterAddress', 'availabilityOracleAddress', + 'registryAddress', ]; /** From 65ad4fd2425a36f495b35955e18669334839c2e7 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 21 Feb 2024 12:26:37 +0000 Subject: [PATCH 2/2] remove duplication --- yarn-project/aztec/src/cli/util.ts | 11 +----- .../ethereum/src/l1_contract_addresses.ts | 38 ++++++------------- 2 files changed, 13 insertions(+), 36 deletions(-) diff --git a/yarn-project/aztec/src/cli/util.ts b/yarn-project/aztec/src/cli/util.ts index 9143abbe99a..3a7a3f499cd 100644 --- a/yarn-project/aztec/src/cli/util.ts +++ b/yarn-project/aztec/src/cli/util.ts @@ -1,21 +1,12 @@ import { ArchiverConfig } from '@aztec/archiver'; import { AztecNodeConfig } from '@aztec/aztec-node'; import { AccountManager } from '@aztec/aztec.js'; -import { L1ContractAddresses } from '@aztec/ethereum'; +import { L1ContractAddresses, l1ContractsNames } from '@aztec/ethereum'; import { EthAddress } from '@aztec/foundation/eth-address'; import { LogFn, createConsoleLogger } from '@aztec/foundation/log'; import { P2PConfig } from '@aztec/p2p'; import { GrumpkinScalar, PXEService, PXEServiceConfig } from '@aztec/pxe'; -const l1ContractsNames = [ - 'rollupAddress', - 'inboxAddress', - 'outboxAddress', - 'contractDeploymentEmitterAddress', - 'availabilityOracleAddress', - 'registryAddress', -]; - /** * Checks if the object has l1Contracts property * @param obj - The object to check diff --git a/yarn-project/ethereum/src/l1_contract_addresses.ts b/yarn-project/ethereum/src/l1_contract_addresses.ts index 272faccb370..147b2ced618 100644 --- a/yarn-project/ethereum/src/l1_contract_addresses.ts +++ b/yarn-project/ethereum/src/l1_contract_addresses.ts @@ -1,31 +1,17 @@ import { EthAddress } from '@aztec/foundation/eth-address'; +export const l1ContractsNames = [ + 'availabilityOracleAddress', + 'rollupAddress', + 'registryAddress', + 'inboxAddress', + 'outboxAddress', + 'contractDeploymentEmitterAddress', +]; + /** * Provides the directory of current L1 contract addresses */ -export interface L1ContractAddresses { - /** - * Availability Oracle Address. - */ - availabilityOracleAddress: EthAddress; - /** - * Rollup Address. - */ - rollupAddress: EthAddress; - /** - * Registry Address. - */ - registryAddress: EthAddress; - /** - * Inbox Address. - */ - inboxAddress: EthAddress; - /** - * Outbox Address. - */ - outboxAddress: EthAddress; - /** - * Data Emitter Address. - */ - contractDeploymentEmitterAddress: EthAddress; -} +export type L1ContractAddresses = { + [K in (typeof l1ContractsNames)[number]]: EthAddress; +};