From 9ea3ecb5ece49bfe53220d33b44a43d8f1494ddd Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 22 Aug 2023 08:32:12 +0000 Subject: [PATCH] chore: re-enabling pubkey check --- .../aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts index e9d867ca30b..a32b8825075 100644 --- a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts +++ b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts @@ -92,10 +92,10 @@ export class AztecRPCServer implements AztecRPC { public async registerAccount(privKey: PrivateKey, account: CompleteAddress) { const pubKey = this.keyStore.addAccount(privKey); - // TODO: Re-enable this check once https://github.com/AztecProtocol/aztec-packages/issues/1556 is solved - // if (!pubKey.equals(account.publicKey)) { - // throw new Error(`Public key mismatch: ${pubKey.toString()} != ${account.publicKey.toString()}`); - // } + if (!pubKey.equals(account.publicKey)) { + // The derived public key must match the one provided in the complete address + throw new Error(`Public key mismatch: ${pubKey.toString()} != ${account.publicKey.toString()}`); + } await this.db.addCompleteAddress(account); this.synchroniser.addAccount(pubKey, this.keyStore); }