Skip to content

Commit

Permalink
refactor: removed getPreimagesAt (#1517)
Browse files Browse the repository at this point in the history
Fixes #1502
  • Loading branch information
benesjan authored Aug 11, 2023
1 parent 1a6168a commit 7e14e7b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
3 changes: 0 additions & 3 deletions yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ export abstract class BaseWallet implements Wallet {
getTxReceipt(txHash: TxHash): Promise<TxReceipt> {
return this.rpc.getTxReceipt(txHash);
}
getPreimagesAt(contract: AztecAddress, storageSlot: Fr): Promise<any> {
return this.rpc.getPreimagesAt(contract, storageSlot);
}
getPublicStorageAt(contract: AztecAddress, storageSlot: Fr): Promise<any> {
return this.rpc.getPublicStorageAt(contract, storageSlot);
}
Expand Down
10 changes: 0 additions & 10 deletions yarn-project/types/src/interfaces/aztec_rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,6 @@ export interface AztecRPC {
*/
getTxReceipt(txHash: TxHash): Promise<TxReceipt>;

/**
* 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<bigint[][]>;

/**
* 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.
Expand Down

0 comments on commit 7e14e7b

Please sign in to comment.