@@ -203,15 +203,11 @@ describe('IexecEscrowToken-receiveApproval', () => {
203203 volume ,
204204 ) ;
205205
206- // Verify frozen balance
207- expect ( await iexecPoco . frozenOf ( requester . address ) ) . to . equal ( dealCost ) ;
208-
209206 // Verify total supply increased
210207 expect ( await iexecPoco . totalSupply ( ) ) . to . equal ( initialTotalSupply + dealCost ) ;
211- // Total balance should be existing + new deposit - frozen
212- expect ( await iexecPoco . balanceOf ( requester . address ) ) . to . equal (
213- initialBalance + dealCost - dealCost ,
214- ) ;
208+ // The available balance remains unchanged because the deposit is immediately frozen
209+ expect ( await iexecPoco . balanceOf ( requester . address ) ) . to . equal ( initialBalance ) ;
210+ // Verify frozen balance
215211 expect ( await iexecPoco . frozenOf ( requester . address ) ) . to . equal ( dealCost ) ;
216212 } ) ;
217213
@@ -290,14 +286,10 @@ describe('IexecEscrowToken-receiveApproval', () => {
290286
291287 const initialBalance = await iexecPoco . balanceOf ( requester . address ) ;
292288 const encodedOrders = encodeOrdersForCallback ( orders ) ;
293- const dealId = getDealId ( iexecWrapper . getDomain ( ) , orders . requester ) ;
294-
295- const tx = rlcInstanceAsRequester . approveAndCall ( proxyAddress , dealCost , encodedOrders ) ;
289+ await rlcInstanceAsRequester . approveAndCall ( proxyAddress , dealCost , encodedOrders ) ;
296290
297- // Total balance should be existing + new deposit - frozen
298- expect ( await iexecPoco . balanceOf ( requester . address ) ) . to . equal (
299- initialBalance + dealCost - dealCost ,
300- ) ;
291+ // The available balance remains unchanged because the deposit is immediately frozen
292+ expect ( await iexecPoco . balanceOf ( requester . address ) ) . to . equal ( initialBalance ) ;
301293 expect ( await iexecPoco . frozenOf ( requester . address ) ) . to . equal ( dealCost ) ;
302294 } ) ;
303295
@@ -438,9 +430,12 @@ describe('IexecEscrowToken-receiveApproval', () => {
438430
439431 const dealCost = 0n ;
440432 const encodedOrders = encodeOrdersForCallback ( ordersZeroPrice ) ;
441- const dealId = getDealId ( iexecWrapper . getDomain ( ) , ordersZeroPrice . requester ) ;
442433
443- const tx = rlcInstanceAsRequester . approveAndCall ( proxyAddress , dealCost , encodedOrders ) ;
434+ const tx = await rlcInstanceAsRequester . approveAndCall (
435+ proxyAddress ,
436+ dealCost ,
437+ encodedOrders ,
438+ ) ;
444439
445440 await expect ( tx )
446441 . to . emit ( iexecPoco , 'Transfer' )
0 commit comments