Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Nov 12, 2024
1 parent 972654a commit b8eb9ce
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions yarn-project/end-to-end/src/guides/dapp_testing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b8eb9ce

Please sign in to comment.