@@ -245,10 +245,10 @@ fn run_fuzz(fuzz_data: FuzzData) {
245
245
// First, transfer all pool tokens to the fee account to avoid withdrawal
246
246
// fees and a potential crash when withdrawing just 1 pool token.
247
247
let mut fee_account = token_swap. pool_fee_account . clone ( ) ;
248
- for mut pool_account in pool_accounts. values_mut ( ) {
248
+ for pool_account in pool_accounts. values_mut ( ) {
249
249
let pool_token_amount = get_token_balance ( pool_account) ;
250
250
if pool_token_amount > 0 {
251
- transfer ( & mut pool_account, & mut fee_account, pool_token_amount) ;
251
+ transfer ( pool_account, & mut fee_account, pool_token_amount) ;
252
252
}
253
253
}
254
254
let mut pool_account = token_swap. pool_token_account . clone ( ) ;
@@ -296,14 +296,14 @@ fn run_fuzz_instruction(
296
296
trade_direction,
297
297
instruction,
298
298
} => {
299
- let mut token_a_account = token_a_accounts. get_mut ( & token_a_id) . unwrap ( ) ;
300
- let mut token_b_account = token_b_accounts. get_mut ( & token_b_id) . unwrap ( ) ;
299
+ let token_a_account = token_a_accounts. get_mut ( & token_a_id) . unwrap ( ) ;
300
+ let token_b_account = token_b_accounts. get_mut ( & token_b_id) . unwrap ( ) ;
301
301
match trade_direction {
302
302
TradeDirection :: AtoB => {
303
- token_swap. swap_a_to_b ( & mut token_a_account, & mut token_b_account, instruction)
303
+ token_swap. swap_a_to_b ( token_a_account, token_b_account, instruction)
304
304
}
305
305
TradeDirection :: BtoA => {
306
- token_swap. swap_b_to_a ( & mut token_b_account, & mut token_a_account, instruction)
306
+ token_swap. swap_b_to_a ( token_b_account, token_a_account, instruction)
307
307
}
308
308
}
309
309
}
@@ -313,13 +313,13 @@ fn run_fuzz_instruction(
313
313
pool_token_id,
314
314
instruction,
315
315
} => {
316
- let mut token_a_account = token_a_accounts. get_mut ( & token_a_id) . unwrap ( ) ;
317
- let mut token_b_account = token_b_accounts. get_mut ( & token_b_id) . unwrap ( ) ;
318
- let mut pool_account = pool_accounts. get_mut ( & pool_token_id) . unwrap ( ) ;
316
+ let token_a_account = token_a_accounts. get_mut ( & token_a_id) . unwrap ( ) ;
317
+ let token_b_account = token_b_accounts. get_mut ( & token_b_id) . unwrap ( ) ;
318
+ let pool_account = pool_accounts. get_mut ( & pool_token_id) . unwrap ( ) ;
319
319
token_swap. deposit_all_token_types (
320
- & mut token_a_account,
321
- & mut token_b_account,
322
- & mut pool_account,
320
+ token_a_account,
321
+ token_b_account,
322
+ pool_account,
323
323
instruction,
324
324
)
325
325
}
@@ -329,13 +329,13 @@ fn run_fuzz_instruction(
329
329
pool_token_id,
330
330
instruction,
331
331
} => {
332
- let mut token_a_account = token_a_accounts. get_mut ( & token_a_id) . unwrap ( ) ;
333
- let mut token_b_account = token_b_accounts. get_mut ( & token_b_id) . unwrap ( ) ;
334
- let mut pool_account = pool_accounts. get_mut ( & pool_token_id) . unwrap ( ) ;
332
+ let token_a_account = token_a_accounts. get_mut ( & token_a_id) . unwrap ( ) ;
333
+ let token_b_account = token_b_accounts. get_mut ( & token_b_id) . unwrap ( ) ;
334
+ let pool_account = pool_accounts. get_mut ( & pool_token_id) . unwrap ( ) ;
335
335
token_swap. withdraw_all_token_types (
336
- & mut pool_account,
337
- & mut token_a_account,
338
- & mut token_b_account,
336
+ pool_account,
337
+ token_a_account,
338
+ token_b_account,
339
339
instruction,
340
340
)
341
341
}
@@ -345,14 +345,14 @@ fn run_fuzz_instruction(
345
345
pool_token_id,
346
346
instruction,
347
347
} => {
348
- let mut source_token_account = match trade_direction {
348
+ let source_token_account = match trade_direction {
349
349
TradeDirection :: AtoB => token_a_accounts. get_mut ( & token_account_id) . unwrap ( ) ,
350
350
TradeDirection :: BtoA => token_b_accounts. get_mut ( & token_account_id) . unwrap ( ) ,
351
351
} ;
352
- let mut pool_account = pool_accounts. get_mut ( & pool_token_id) . unwrap ( ) ;
352
+ let pool_account = pool_accounts. get_mut ( & pool_token_id) . unwrap ( ) ;
353
353
token_swap. deposit_single_token_type_exact_amount_in (
354
- & mut source_token_account,
355
- & mut pool_account,
354
+ source_token_account,
355
+ pool_account,
356
356
instruction,
357
357
)
358
358
}
@@ -362,14 +362,14 @@ fn run_fuzz_instruction(
362
362
pool_token_id,
363
363
instruction,
364
364
} => {
365
- let mut destination_token_account = match trade_direction {
365
+ let destination_token_account = match trade_direction {
366
366
TradeDirection :: AtoB => token_a_accounts. get_mut ( & token_account_id) . unwrap ( ) ,
367
367
TradeDirection :: BtoA => token_b_accounts. get_mut ( & token_account_id) . unwrap ( ) ,
368
368
} ;
369
- let mut pool_account = pool_accounts. get_mut ( & pool_token_id) . unwrap ( ) ;
369
+ let pool_account = pool_accounts. get_mut ( & pool_token_id) . unwrap ( ) ;
370
370
token_swap. withdraw_single_token_type_exact_amount_out (
371
- & mut pool_account,
372
- & mut destination_token_account,
371
+ pool_account,
372
+ destination_token_account,
373
373
instruction,
374
374
)
375
375
}
0 commit comments