From b8eb9ce7285e6aca58c891b90c3d3d93e8dce591 Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 12 Nov 2024 20:47:45 +0000 Subject: [PATCH] fix. --- .../end-to-end/src/guides/dapp_testing.test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/yarn-project/end-to-end/src/guides/dapp_testing.test.ts b/yarn-project/end-to-end/src/guides/dapp_testing.test.ts index 1fea3491017..ffe17819f62 100644 --- a/yarn-project/end-to-end/src/guides/dapp_testing.test.ts +++ b/yarn-project/end-to-end/src/guides/dapp_testing.test.ts @@ -121,7 +121,10 @@ describe('guides/dapp/testing', () => { it('checks public storage', async () => { // docs:start:public-storage await token.methods.mint_public(owner.getAddress(), 100n).send().wait(); - const ownerPublicBalanceSlot = cheats.aztec.computeSlotInMap(6n, owner.getAddress()); + const ownerPublicBalanceSlot = cheats.aztec.computeSlotInMap( + TokenContract.storage.public_balances.slot, + owner.getAddress(), + ); const balance = await pxe.getPublicStorageAt(token.address, ownerPublicBalanceSlot); expect(balance.value).toEqual(100n); // docs:end:public-storage @@ -179,7 +182,10 @@ describe('guides/dapp/testing', () => { const call = token.methods.transfer_public(owner.getAddress(), recipient.getAddress(), 1000n, 0); const receipt = await call.send({ skipPublicSimulation: true }).wait({ dontThrowOnRevert: true }); expect(receipt.status).toEqual(TxStatus.APP_LOGIC_REVERTED); - const ownerPublicBalanceSlot = cheats.aztec.computeSlotInMap(6n, owner.getAddress()); + const ownerPublicBalanceSlot = cheats.aztec.computeSlotInMap( + TokenContract.storage.public_balances.slot, + owner.getAddress(), + ); const balance = await pxe.getPublicStorageAt(token.address, ownerPublicBalanceSlot); expect(balance.value).toEqual(100n); // docs:end:pub-reverted