From 7e14e7bbea7d092242ac2e6ae03086fe5b9a9ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bene=C5=A1?= Date: Fri, 11 Aug 2023 10:46:06 +0200 Subject: [PATCH] refactor: removed `getPreimagesAt` (#1517) Fixes #1502 --- .../aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts | 5 ----- yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts | 3 --- yarn-project/types/src/interfaces/aztec_rpc.ts | 10 ---------- 3 files changed, 18 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 9554e33c58b..f12fbb75757 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 @@ -143,11 +143,6 @@ export class AztecRPCServer implements AztecRPC { return Promise.resolve(result); } - public async getPreimagesAt(contract: AztecAddress, storageSlot: Fr) { - const noteSpendingInfo = await this.db.getNoteSpendingInfo(contract, storageSlot); - return noteSpendingInfo.map(d => d.notePreimage.items.map(item => item.value)); - } - public async getPublicStorageAt(contract: AztecAddress, storageSlot: Fr) { if ((await this.getContractData(contract)) === undefined) { throw new Error(`Contract ${contract.toString()} is not deployed`); diff --git a/yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts b/yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts index c6181b286e5..6a71a3490a4 100644 --- a/yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts +++ b/yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts @@ -56,9 +56,6 @@ export abstract class BaseWallet implements Wallet { getTxReceipt(txHash: TxHash): Promise { return this.rpc.getTxReceipt(txHash); } - getPreimagesAt(contract: AztecAddress, storageSlot: Fr): Promise { - return this.rpc.getPreimagesAt(contract, storageSlot); - } getPublicStorageAt(contract: AztecAddress, storageSlot: Fr): Promise { return this.rpc.getPublicStorageAt(contract, storageSlot); } diff --git a/yarn-project/types/src/interfaces/aztec_rpc.ts b/yarn-project/types/src/interfaces/aztec_rpc.ts index 9483505bae5..a12de8b246b 100644 --- a/yarn-project/types/src/interfaces/aztec_rpc.ts +++ b/yarn-project/types/src/interfaces/aztec_rpc.ts @@ -113,16 +113,6 @@ export interface AztecRPC { */ getTxReceipt(txHash: TxHash): Promise; - /** - * Retrieves the preimage data at a specified contract address and storage slot. - * The returned data is an array of note preimage items, with each item containing its value. - * - * @param contract - The AztecAddress of the target contract. - * @param storageSlot - The Fr representing the storage slot to be fetched. - * @returns A promise that resolves to an array of note preimage items, each containing its value. - */ - getPreimagesAt(contract: AztecAddress, storageSlot: Fr): Promise; - /** * Retrieves the public storage data at a specified contract address and storage slot. * The returned data is data at the storage slot or throws an error if the contract is not deployed.