From 930ccb50f8c2d1c9cd32978e14127a20e7360ae7 Mon Sep 17 00:00:00 2001 From: LHerskind <16536249+LHerskind@users.noreply.github.com> Date: Thu, 13 Mar 2025 10:54:45 +0000 Subject: [PATCH] fix: cheatcode test read incorrectly from note --- yarn-project/end-to-end/src/e2e_cheat_codes.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts b/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts index ebdec0d7dabb..9dccff437496 100644 --- a/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts +++ b/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts @@ -189,7 +189,11 @@ describe('e2e_cheat_codes', () => { // check if note was added to pending shield: const notes = await cc.aztec.loadPrivate(admin, token.address, balancesAdminSlot); - const values = notes.map(note => note.items[0]); + + // @note If you get pain for dinner, this guys is the reason. + // Assuming that it is still testing the token contract, you need to look at the balances, + // and then the type of note, currently a `UintNote` which stores fields: [owner, randomness, amount] + const values = notes.map(note => note.items[2]); const balance = values.reduce((sum, current) => sum + current.toBigInt(), 0n); expect(balance).toEqual(mintAmount); // docs:end:load_private_cheatcode