@@ -121,7 +121,10 @@ describe('guides/dapp/testing', () => {
121
121
it ( 'checks public storage' , async ( ) => {
122
122
// docs:start:public-storage
123
123
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
+ ) ;
125
128
const balance = await pxe . getPublicStorageAt ( token . address , ownerPublicBalanceSlot ) ;
126
129
expect ( balance . value ) . toEqual ( 100n ) ;
127
130
// docs:end:public-storage
@@ -179,7 +182,10 @@ describe('guides/dapp/testing', () => {
179
182
const call = token . methods . transfer_public ( owner . getAddress ( ) , recipient . getAddress ( ) , 1000n , 0 ) ;
180
183
const receipt = await call . send ( { skipPublicSimulation : true } ) . wait ( { dontThrowOnRevert : true } ) ;
181
184
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
+ ) ;
183
189
const balance = await pxe . getPublicStorageAt ( token . address , ownerPublicBalanceSlot ) ;
184
190
expect ( balance . value ) . toEqual ( 100n ) ;
185
191
// docs:end:pub-reverted
0 commit comments