From 02e0cf0c56692879eefbfd8e43d0cccb31310e0a Mon Sep 17 00:00:00 2001 From: sklppy88 Date: Sat, 7 Dec 2024 21:06:31 +0000 Subject: [PATCH] init --- .../aztec.js/src/wallet/base_wallet.ts | 3 --- .../circuit-types/src/interfaces/pxe.test.ts | 9 ------- .../circuit-types/src/interfaces/pxe.ts | 8 ------ .../end-to-end/src/e2e_2_pxes.test.ts | 5 ---- .../pxe/src/pxe_service/pxe_service.ts | 27 ------------------- 5 files changed, 52 deletions(-) diff --git a/yarn-project/aztec.js/src/wallet/base_wallet.ts b/yarn-project/aztec.js/src/wallet/base_wallet.ts index 70d6c0556d0..db69a1347ac 100644 --- a/yarn-project/aztec.js/src/wallet/base_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/base_wallet.ts @@ -119,9 +119,6 @@ export abstract class BaseWallet implements Wallet { getIncomingNotes(filter: IncomingNotesFilter): Promise { return this.pxe.getIncomingNotes(filter); } - getOutgoingNotes(filter: OutgoingNotesFilter): Promise { - return this.pxe.getOutgoingNotes(filter); - } getPublicStorageAt(contract: AztecAddress, storageSlot: Fr): Promise { return this.pxe.getPublicStorageAt(contract, storageSlot); } diff --git a/yarn-project/circuit-types/src/interfaces/pxe.test.ts b/yarn-project/circuit-types/src/interfaces/pxe.test.ts index f4c4e34050e..ffeb3f57e9b 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.test.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.test.ts @@ -196,11 +196,6 @@ describe('PXESchema', () => { expect(result).toEqual([expect.any(BigInt), expect.any(SiblingPath)]); }); - it('getOutgoingNotes', async () => { - const result = await context.client.getOutgoingNotes({ contractAddress: address }); - expect(result).toEqual([expect.any(UniqueNote)]); - }); - it('addNote', async () => { await context.client.addNote(ExtendedNote.random(), address); }); @@ -428,10 +423,6 @@ class MockPXE implements PXE { expect(secret).toBeInstanceOf(Fr); return Promise.resolve([1n, SiblingPath.random(L1_TO_L2_MSG_TREE_HEIGHT)]); } - getOutgoingNotes(filter: OutgoingNotesFilter): Promise { - expect(filter.contractAddress).toEqual(this.address); - return Promise.resolve([UniqueNote.random()]); - } addNote(note: ExtendedNote, scope?: AztecAddress | undefined): Promise { expect(note).toBeInstanceOf(ExtendedNote); expect(scope).toEqual(this.address); diff --git a/yarn-project/circuit-types/src/interfaces/pxe.ts b/yarn-project/circuit-types/src/interfaces/pxe.ts index 703bad79ec8..f6eb1008427 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.ts @@ -245,13 +245,6 @@ export interface PXE { secret: Fr, ): Promise<[bigint, SiblingPath]>; - /** - * Gets outgoing notes of accounts registered in this PXE based on the provided filter. - * @param filter - The filter to apply to the notes. - * @returns The requested notes. - */ - getOutgoingNotes(filter: OutgoingNotesFilter): Promise; - /** * Adds a note to the database. * @throws If the note hash of the note doesn't exist in the tree. @@ -494,7 +487,6 @@ export const PXESchema: ApiSchemaFor = { .function() .args(schemas.AztecAddress, schemas.Fr, schemas.Fr) .returns(z.tuple([schemas.BigInt, SiblingPath.schemaFor(L1_TO_L2_MSG_TREE_HEIGHT)])), - getOutgoingNotes: z.function().args(OutgoingNotesFilterSchema).returns(z.array(UniqueNote.schema)), addNote: z.function().args(ExtendedNote.schema, optional(schemas.AztecAddress)).returns(z.void()), addNullifiedNote: z.function().args(ExtendedNote.schema).returns(z.void()), getBlock: z diff --git a/yarn-project/end-to-end/src/e2e_2_pxes.test.ts b/yarn-project/end-to-end/src/e2e_2_pxes.test.ts index d3dded0788d..654fbf24da1 100644 --- a/yarn-project/end-to-end/src/e2e_2_pxes.test.ts +++ b/yarn-project/end-to-end/src/e2e_2_pxes.test.ts @@ -256,13 +256,8 @@ describe('e2e_2_pxes', () => { .wait(); await testContract.methods.sync_notes().simulate(); const incomingNotes = await walletA.getIncomingNotes({ txHash: receipt.txHash }); - const outgoingNotes = await walletA.getOutgoingNotes({ txHash: receipt.txHash }); expect(incomingNotes).toHaveLength(1); note = incomingNotes[0]; - - // Since owner is the same as outgoing viewer the incoming and outgoing notes should be the same - expect(outgoingNotes).toHaveLength(1); - expect(outgoingNotes[0]).toEqual(note); } // 3. Nullify the note diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index b46e57ffa95..017694f7df0 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -320,33 +320,6 @@ export class PXEService implements PXE { return Promise.all(extendedNotes); } - public async getOutgoingNotes(filter: OutgoingNotesFilter): Promise { - const noteDaos = await this.db.getOutgoingNotes(filter); - - const extendedNotes = noteDaos.map(async dao => { - let owner = filter.owner; - if (owner === undefined) { - const completeAddresses = (await this.db.getCompleteAddresses()).find(address => - address.publicKeys.masterOutgoingViewingPublicKey.equals(dao.ovpkM), - ); - if (completeAddresses === undefined) { - throw new Error(`Cannot find complete address for OvpkM ${dao.ovpkM.toString()}`); - } - owner = completeAddresses.address; - } - return new UniqueNote( - dao.note, - owner, - dao.contractAddress, - dao.storageSlot, - dao.noteTypeId, - dao.txHash, - dao.nonce, - ); - }); - return Promise.all(extendedNotes); - } - public async getL1ToL2MembershipWitness( contractAddress: AztecAddress, messageHash: Fr,