Skip to content

Commit

Permalink
docs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Oct 30, 2024
1 parent 7bd800f commit eb0097e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/docs/guides/developer_guides/js_apps/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ You can use the `debug` option in the `wait` method to get more information abou

This debug information will be populated in the transaction receipt. You can log it to the console or use it to make assertions about the transaction.

#include_code debug /yarn-project/end-to-end/src/e2e_token_contract/minting.test.ts typescript
#include_code debug /yarn-project/end-to-end/src/e2e_token_contract/private_transfer_recursion.test.ts typescript

You can also log directly from Aztec contracts. Read [this guide](../../../reference/developer_references/debugging.md#logging-in-aztecnr) for some more information.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ When you send someone a note, the note hash gets added to the note hash tree. To
1. When sending someone a note, use `encrypt_and_emit_note` (the function encrypts the log in such a way that only a recipient can decrypt it). PXE then tries to decrypt all the encrypted logs, and stores the successfully decrypted one. [More info here](../how_to_emit_event.md)
2. Manually using `pxe.addNote()` - If you choose to not emit logs to save gas or when creating a note in the public domain and want to consume it in private domain (`encrypt_and_emit_note` shouldn't be called in the public domain because everything is public), like in the previous section where we created a TransparentNote in public.

#include_code pxe_add_note yarn-project/end-to-end/src/e2e_cheat_codes.test.ts typescript
#include_code pxe_add_note yarn-project/end-to-end/src/composed/e2e_persistence.test.ts typescript

In the token contract, TransparentNotes are stored in a set called "pending_shields" which is in storage slot 5tutorials/tutorials/codealong/contract_tutorials/token_contract.md#contract-storage)

Expand Down
2 changes: 2 additions & 0 deletions yarn-project/end-to-end/src/composed/e2e_persistence.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ async function addPendingShieldNoteToPXE(
secretHash: Fr,
txHash: TxHash,
) {
// docs:start:pxe_add_note
const note = new Note([new Fr(amount), secretHash]);
const extendedNote = new ExtendedNote(
note,
Expand All @@ -349,4 +350,5 @@ async function addPendingShieldNoteToPXE(
txHash,
);
await wallet.addNote(extendedNote);
// docs:end:pxe_add_note
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ describe('e2e_token_contract private transfer recursion', () => {
// itself to consume them all (since it retrieves 2 notes on the first pass and 8 in each subsequent pass).
const totalNotes = 16;
const totalBalance = await mintNotes(Array(totalNotes).fill(10n));
// docs:start:debug
const tx = await asset.methods.transfer(accounts[1].address, totalBalance).send().wait({ debug: true });
// docs:end:debug

// We should have nullified all notes, plus an extra nullifier for the transaction
expect(tx.debugInfo?.nullifiers.length).toBe(totalNotes + 1);
Expand Down

0 comments on commit eb0097e

Please sign in to comment.