Skip to content

Commit b8eb9ce

Browse files
committed
fix.
1 parent 972654a commit b8eb9ce

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

yarn-project/end-to-end/src/guides/dapp_testing.test.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ describe('guides/dapp/testing', () => {
121121
it('checks public storage', async () => {
122122
// docs:start:public-storage
123123
await token.methods.mint_public(owner.getAddress(), 100n).send().wait();
124-
const ownerPublicBalanceSlot = cheats.aztec.computeSlotInMap(6n, owner.getAddress());
124+
const ownerPublicBalanceSlot = cheats.aztec.computeSlotInMap(
125+
TokenContract.storage.public_balances.slot,
126+
owner.getAddress(),
127+
);
125128
const balance = await pxe.getPublicStorageAt(token.address, ownerPublicBalanceSlot);
126129
expect(balance.value).toEqual(100n);
127130
// docs:end:public-storage
@@ -179,7 +182,10 @@ describe('guides/dapp/testing', () => {
179182
const call = token.methods.transfer_public(owner.getAddress(), recipient.getAddress(), 1000n, 0);
180183
const receipt = await call.send({ skipPublicSimulation: true }).wait({ dontThrowOnRevert: true });
181184
expect(receipt.status).toEqual(TxStatus.APP_LOGIC_REVERTED);
182-
const ownerPublicBalanceSlot = cheats.aztec.computeSlotInMap(6n, owner.getAddress());
185+
const ownerPublicBalanceSlot = cheats.aztec.computeSlotInMap(
186+
TokenContract.storage.public_balances.slot,
187+
owner.getAddress(),
188+
);
183189
const balance = await pxe.getPublicStorageAt(token.address, ownerPublicBalanceSlot);
184190
expect(balance.value).toEqual(100n);
185191
// docs:end:pub-reverted

0 commit comments

Comments
 (0)