Skip to content

Commit

Permalink
better naming + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Oct 31, 2023
1 parent a08b1c4 commit 38d8868
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions yarn-project/aztec.js/src/contract/sent_tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class SentTx {
if (receipt.status !== TxStatus.MINED)
throw new Error(`Transaction ${await this.getTxHash()} was ${receipt.status}`);
if (opts?.getNotes) {
receipt.notes = await this.pxe.getNotes({ txHash: await this.getTxHash() });
receipt.visibleNotes = await this.pxe.getNotes({ txHash: await this.getTxHash() });
}
return receipt;
}
Expand All @@ -84,11 +84,11 @@ export class SentTx {
}

/**
* Gets notes created in this tx.
* Get notes OF ACCOUNTS REGISTERED IN THE PROVIDED PXE/WALLET created in this tx.
* @remarks This function will wait for the tx to be mined if it hasn't been already.
* @returns The requested notes.
*/
public async getNotes(): Promise<ExtendedNote[]> {
public async getVisibleNotes(): Promise<ExtendedNote[]> {
await this.wait();
return this.pxe.getNotes({ txHash: await this.getTxHash() });
}
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_token_contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('e2e_token_contract', () => {
expect(receiptClaim.status).toBe(TxStatus.MINED);
tokenSim.redeemShield(accounts[0].address, amount);
// 1 note should be created containing `amount` of tokens
const notes = receiptClaim.notes!;
const notes = receiptClaim.visibleNotes!;
expect(notes.length).toBe(1);
expect(notes[0].note.items[0].toBigInt()).toBe(amount);
});
Expand Down
6 changes: 4 additions & 2 deletions yarn-project/types/src/tx/tx_receipt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ export class TxReceipt {
*/
public contractAddress?: AztecAddress,
/**
* Notes created in this tx.
* Notes created in this tx which belong to accounts which are registered in the PXE which was used to submit the
* tx. YOU WILL NOT RECEIVE NOTES OF ACCOUNTS WHICH ARE NOT REGISTERED IN THE PXE HERE even though they were
* created in this tx.
*/
public notes?: ExtendedNote[],
public visibleNotes?: ExtendedNote[],
) {}

/**
Expand Down

0 comments on commit 38d8868

Please sign in to comment.