@@ -27,7 +27,7 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
27
27
//////////////////////////////////////////////////////////////////////////*/
28
28
29
29
function test_RevertWhen_CustomError () external {
30
- // The calls declared as bytes
30
+ // The calls declared as bytes.
31
31
bytes [] memory calls = new bytes [](1 );
32
32
calls[0 ] = abi.encodeCall (flow.withdrawMax, (1 , users.recipient));
33
33
@@ -51,7 +51,7 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
51
51
address noAllowanceAddress = address (0xBEEF );
52
52
resetPrank ({ msgSender: noAllowanceAddress });
53
53
54
- // The calls declared as bytes
54
+ // The calls declared as bytes.
55
55
bytes [] memory calls = new bytes [](1 );
56
56
calls[0 ] = abi.encodeCall (flow.deposit, (streamId, DEPOSIT_AMOUNT_6D, users.sender, users.recipient));
57
57
@@ -78,7 +78,7 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
78
78
}
79
79
80
80
/*//////////////////////////////////////////////////////////////////////////
81
- ADJUST-RATE-PER-SECOND-MULTIPLE
81
+ ADJUST-RATE-PER-SECOND
82
82
//////////////////////////////////////////////////////////////////////////*/
83
83
84
84
function test_Batch_AdjustRatePerSecond () external {
@@ -122,22 +122,22 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
122
122
}
123
123
124
124
/*//////////////////////////////////////////////////////////////////////////
125
- CREATE-MULTIPLE
125
+ CREATE
126
126
//////////////////////////////////////////////////////////////////////////*/
127
127
128
- function test_Batch_CreateMultiple () external {
128
+ function test_Batch_Create () external {
129
129
uint256 [] memory expectedStreamIds = new uint256 [](2 );
130
130
expectedStreamIds[0 ] = flow.nextStreamId ();
131
- expectedStreamIds[1 ] = expectedStreamIds[ 0 ] + 1 ;
131
+ expectedStreamIds[1 ] = flow. nextStreamId () + 1 ;
132
132
133
- // The calls declared as bytes
133
+ // The calls declared as bytes.
134
134
bytes [] memory calls = new bytes [](2 );
135
135
calls[0 ] = abi.encodeCall (flow.create, (users.sender, users.recipient, RATE_PER_SECOND, usdc, TRANSFERABLE));
136
136
calls[1 ] = abi.encodeCall (flow.create, (users.sender, users.recipient, RATE_PER_SECOND, usdc, TRANSFERABLE));
137
137
138
- // It should emit events: 2 {MetadataUpdate}, 2 {CreateFlowStream}
138
+ // It should emit 2 {MetadataUpdate} and 2 {CreateFlowStream} events.
139
139
140
- // First stream to create
140
+ // First stream to create.
141
141
vm.expectEmit ({ emitter: address (flow) });
142
142
emit IERC4906 .MetadataUpdate ({ _tokenId: expectedStreamIds[0 ] });
143
143
@@ -151,7 +151,7 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
151
151
transferable: TRANSFERABLE
152
152
});
153
153
154
- // Second stream to create
154
+ // Second stream to create.
155
155
vm.expectEmit ({ emitter: address (flow) });
156
156
emit IERC4906 .MetadataUpdate ({ _tokenId: expectedStreamIds[1 ] });
157
157
@@ -170,18 +170,18 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
170
170
}
171
171
172
172
/*//////////////////////////////////////////////////////////////////////////
173
- DEPOSIT-MULTIPLE
173
+ DEPOSIT
174
174
//////////////////////////////////////////////////////////////////////////*/
175
175
176
- function test_Batch_DepositMultiple () external {
177
- // The calls declared as bytes
176
+ function test_Batch_Deposit () external {
177
+ // The calls declared as bytes.
178
178
bytes [] memory calls = new bytes [](2 );
179
179
calls[0 ] = abi.encodeCall (flow.deposit, (defaultStreamIds[0 ], DEPOSIT_AMOUNT_6D, users.sender, users.recipient));
180
180
calls[1 ] = abi.encodeCall (flow.deposit, (defaultStreamIds[1 ], DEPOSIT_AMOUNT_6D, users.sender, users.recipient));
181
181
182
182
// It should emit 2 {Transfer}, 2 {DepositFlowStream}, 2 {MetadataUpdate} events.
183
183
184
- // First stream to deposit
184
+ // First stream to deposit.
185
185
vm.expectEmit ({ emitter: address (usdc) });
186
186
emit IERC20 .Transfer ({ from: users.sender, to: address (flow), value: DEPOSIT_AMOUNT_6D });
187
187
@@ -195,7 +195,7 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
195
195
vm.expectEmit ({ emitter: address (flow) });
196
196
emit IERC4906 .MetadataUpdate ({ _tokenId: defaultStreamIds[0 ] });
197
197
198
- // Second stream to deposit
198
+ // Second stream to deposit.
199
199
vm.expectEmit ({ emitter: address (usdc) });
200
200
emit IERC20 .Transfer ({ from: users.sender, to: address (flow), value: DEPOSIT_AMOUNT_6D });
201
201
@@ -218,21 +218,21 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
218
218
}
219
219
220
220
/*//////////////////////////////////////////////////////////////////////////
221
- PAUSE-MULTIPLE
221
+ PAUSE
222
222
//////////////////////////////////////////////////////////////////////////*/
223
223
224
- function test_Batch_PauseMultiple () external {
225
- // The calls declared as bytes
224
+ function test_Batch_Pause () external {
225
+ // The calls declared as bytes.
226
226
bytes [] memory calls = new bytes [](2 );
227
227
calls[0 ] = abi.encodeCall (flow.pause, (defaultStreamIds[0 ]));
228
228
calls[1 ] = abi.encodeCall (flow.pause, (defaultStreamIds[1 ]));
229
229
230
230
uint256 previousTotalDebt0 = flow.totalDebtOf (defaultStreamId);
231
231
uint256 previousTotalDebt1 = flow.totalDebtOf (defaultStreamIds[1 ]);
232
232
233
- // It should emit 2 {PauseFlowStream}, 2 {MetadataUpdate} events.
233
+ // It should emit 2 {PauseFlowStream} and 2 {MetadataUpdate} events.
234
234
235
- // First stream pause
235
+ // First stream pause.
236
236
vm.expectEmit ({ emitter: address (flow) });
237
237
emit ISablierFlow.PauseFlowStream ({
238
238
streamId: defaultStreamIds[0 ],
@@ -244,7 +244,7 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
244
244
vm.expectEmit ({ emitter: address (flow) });
245
245
emit IERC4906 .MetadataUpdate ({ _tokenId: defaultStreamIds[0 ] });
246
246
247
- // Second stream pause
247
+ // Second stream pause.
248
248
vm.expectEmit ({ emitter: address (flow) });
249
249
emit ISablierFlow.PauseFlowStream ({
250
250
streamId: defaultStreamIds[1 ],
@@ -261,19 +261,21 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
261
261
}
262
262
263
263
/*//////////////////////////////////////////////////////////////////////////
264
- REFUND-MULTIPLE
264
+ REFUND
265
265
//////////////////////////////////////////////////////////////////////////*/
266
266
267
- function test_Batch_RefundMultiple () external {
267
+ function test_Batch_Refund () external {
268
268
depositDefaultAmount (defaultStreamIds[0 ]);
269
269
depositDefaultAmount (defaultStreamIds[1 ]);
270
270
271
- // The calls declared as bytes
271
+ // The calls declared as bytes.
272
272
bytes [] memory calls = new bytes [](2 );
273
273
calls[0 ] = abi.encodeCall (flow.refund, (defaultStreamIds[0 ], REFUND_AMOUNT_6D));
274
274
calls[1 ] = abi.encodeCall (flow.refund, (defaultStreamIds[1 ], REFUND_AMOUNT_6D));
275
275
276
276
// It should emit 2 {Transfer} and 2 {RefundFromFlowStream} events.
277
+
278
+ // First stream refund.
277
279
vm.expectEmit ({ emitter: address (usdc) });
278
280
emit IERC20 .Transfer ({ from: address (flow), to: users.sender, value: REFUND_AMOUNT_6D });
279
281
@@ -284,7 +286,7 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
284
286
amount: REFUND_AMOUNT_6D
285
287
});
286
288
287
- // Second stream refund
289
+ // Second stream refund.
288
290
vm.expectEmit ({ emitter: address (usdc) });
289
291
emit IERC20 .Transfer ({ from: address (flow), to: users.sender, value: REFUND_AMOUNT_6D });
290
292
@@ -304,21 +306,21 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
304
306
}
305
307
306
308
/*//////////////////////////////////////////////////////////////////////////
307
- RESTART-MULTIPLE
309
+ RESTART
308
310
//////////////////////////////////////////////////////////////////////////*/
309
311
310
- function test_Batch_RestartMultiple () external {
312
+ function test_Batch_Restart () external {
311
313
flow.pause ({ streamId: defaultStreamIds[0 ] });
312
314
flow.pause ({ streamId: defaultStreamIds[1 ] });
313
315
314
- // The calls declared as bytes
316
+ // The calls declared as bytes.
315
317
bytes [] memory calls = new bytes [](2 );
316
318
calls[0 ] = abi.encodeCall (flow.restart, (defaultStreamIds[0 ], RATE_PER_SECOND));
317
319
calls[1 ] = abi.encodeCall (flow.restart, (defaultStreamIds[1 ], RATE_PER_SECOND));
318
320
319
321
// It should emit 2 {RestartFlowStream} and 2 {MetadataUpdate} events.
320
322
321
- // First stream restart
323
+ // First stream restart.
322
324
vm.expectEmit ({ emitter: address (flow) });
323
325
emit ISablierFlow.RestartFlowStream ({
324
326
streamId: defaultStreamIds[0 ],
@@ -329,7 +331,7 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
329
331
vm.expectEmit ({ emitter: address (flow) });
330
332
emit IERC4906 .MetadataUpdate ({ _tokenId: defaultStreamIds[0 ] });
331
333
332
- // Second stream restart
334
+ // Second stream restart.
333
335
vm.expectEmit ({ emitter: address (flow) });
334
336
emit ISablierFlow.RestartFlowStream ({
335
337
streamId: defaultStreamIds[1 ],
@@ -345,21 +347,21 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
345
347
}
346
348
347
349
/*//////////////////////////////////////////////////////////////////////////
348
- WITHDRAW-MULTIPLE
350
+ WITHDRAW
349
351
//////////////////////////////////////////////////////////////////////////*/
350
352
351
- function test_Batch_WithdrawMultiple () external {
353
+ function test_Batch_Withdraw () external {
352
354
depositDefaultAmount (defaultStreamIds[0 ]);
353
355
depositDefaultAmount (defaultStreamIds[1 ]);
354
356
355
- // The calls declared as bytes
357
+ // The calldata encoded as a bytes array.
356
358
bytes [] memory calls = new bytes [](2 );
357
359
calls[0 ] = abi.encodeCall (flow.withdraw, (defaultStreamIds[0 ], users.recipient, WITHDRAW_AMOUNT_6D));
358
360
calls[1 ] = abi.encodeCall (flow.withdraw, (defaultStreamIds[1 ], users.recipient, WITHDRAW_AMOUNT_6D));
359
361
360
362
// It should emit 2 {Transfer}, 2 {WithdrawFromFlowStream} and 2 {MetadataUpdated} events.
361
363
362
- // First stream withdraw
364
+ // First stream withdrawal.
363
365
vm.expectEmit ({ emitter: address (usdc) });
364
366
emit IERC20 .Transfer ({ from: address (flow), to: users.recipient, value: WITHDRAW_AMOUNT_6D });
365
367
@@ -376,7 +378,7 @@ contract Batch_Integration_Concrete_Test is Shared_Integration_Concrete_Test {
376
378
vm.expectEmit ({ emitter: address (flow) });
377
379
emit IERC4906 .MetadataUpdate ({ _tokenId: defaultStreamIds[0 ] });
378
380
379
- // Second stream withdraw
381
+ // Second stream withdrawal.
380
382
vm.expectEmit ({ emitter: address (usdc) });
381
383
emit IERC20 .Transfer ({ from: address (flow), to: users.recipient, value: WITHDRAW_AMOUNT_6D });
382
384
0 commit comments