diff --git a/programs/openbook-v2/fuzz/fuzz_targets/multiple_orders.rs b/programs/openbook-v2/fuzz/fuzz_targets/multiple_orders.rs index 9d9459499..6898a0c4c 100644 --- a/programs/openbook-v2/fuzz/fuzz_targets/multiple_orders.rs +++ b/programs/openbook-v2/fuzz/fuzz_targets/multiple_orders.rs @@ -31,7 +31,7 @@ impl FuzzData { FuzzInstruction::PlaceOrder { .. } | FuzzInstruction::PlaceOrderPegged { .. } | FuzzInstruction::PlaceTakeOrder { .. } - | FuzzInstruction::CancelAndPlaceOrders { .. } + | FuzzInstruction::CancelAllAndPlaceOrders { .. } ) }) } @@ -73,9 +73,9 @@ enum FuzzInstruction { data: openbook_v2::instruction::EditOrderPegged, makers: Option>, }, - CancelAndPlaceOrders { + CancelAllAndPlaceOrders { user_id: UserId, - data: openbook_v2::instruction::CancelAndPlaceOrders, + data: openbook_v2::instruction::CancelAllAndPlaceOrders, makers: Option>, }, CancelOrder { @@ -171,13 +171,13 @@ impl FuzzRunner for FuzzContext { .edit_order_pegged(user_id, data, makers.as_ref()) .map_or_else(error_parser::edit_order_pegged, keep), - FuzzInstruction::CancelAndPlaceOrders { + FuzzInstruction::CancelAllAndPlaceOrders { user_id, data, makers, } => self - .cancel_and_place_orders(user_id, data, makers.as_ref()) - .map_or_else(error_parser::cancel_and_place_orders, keep), + .cancel_all_and_place_orders(user_id, data, makers.as_ref()) + .map_or_else(error_parser::cancel_all_and_place_orders, keep), FuzzInstruction::CancelOrder { user_id, data } => self .cancel_order(user_id, data) @@ -534,7 +534,7 @@ mod error_parser { } } - pub fn cancel_and_place_orders(err: ProgramError) -> Corpus { + pub fn cancel_all_and_place_orders(err: ProgramError) -> Corpus { match err { e if e == OpenBookError::InvalidInputLots.into() => Corpus::Reject, e if e == OpenBookError::InvalidInputLotsSize.into() => Corpus::Reject, diff --git a/programs/openbook-v2/fuzz/src/lib.rs b/programs/openbook-v2/fuzz/src/lib.rs index c2d668ee1..be364ce42 100644 --- a/programs/openbook-v2/fuzz/src/lib.rs +++ b/programs/openbook-v2/fuzz/src/lib.rs @@ -603,15 +603,15 @@ impl FuzzContext { process_instruction(&mut self.state, data, &accounts, &remaining) } - pub fn cancel_and_place_orders( + pub fn cancel_all_and_place_orders( &mut self, user_id: &UserId, - data: &openbook_v2::instruction::CancelAndPlaceOrders, + data: &openbook_v2::instruction::CancelAllAndPlaceOrders, makers: Option<&HashSet>, ) -> ProgramResult { let user = self.get_or_create_new_user(user_id); - let accounts = openbook_v2::accounts::CancelAndPlaceOrders { + let accounts = openbook_v2::accounts::CancelAllAndPlaceOrders { open_orders_account: user.open_orders, signer: user.owner, user_base_account: user.base_vault,