File tree Expand file tree Collapse file tree 10 files changed +22
-28
lines changed
modules/matching-engine-testing/tests
programs/matching-engine/src/fallback/processor Expand file tree Collapse file tree 10 files changed +22
-28
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ pub async fn initialize_fast_market_order_shimful(
62
62
. clone ( )
63
63
. unwrap_or_else ( || testing_context. testing_actors . payer_signer . clone ( ) ) ;
64
64
let guardian_signature_info = create_guardian_signatures (
65
- & testing_context,
65
+ testing_context,
66
66
test_context,
67
67
& payer_signer,
68
68
& fast_transfer_vaa. vaa_data ,
@@ -166,7 +166,7 @@ pub fn initialize_fast_market_order_shimful_instruction(
166
166
fast_market_order_account : & fast_market_order_account,
167
167
guardian_set : & guardian_signature_info. guardian_set_pubkey ,
168
168
guardian_set_signatures : & guardian_signature_info. guardian_signatures_pubkey ,
169
- from_endpoint : from_endpoint ,
169
+ from_endpoint,
170
170
verify_vaa_shim_program : & WORMHOLE_VERIFY_VAA_SHIM_PID ,
171
171
system_program : & solana_program:: system_program:: ID ,
172
172
} ;
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ pub async fn evaluate_place_initial_offer_shimful_state(
164
164
. get_active_auction ( )
165
165
. unwrap ( ) ;
166
166
active_auction_state
167
- . verify_auction ( & testing_context, test_context)
167
+ . verify_auction ( testing_context, test_context)
168
168
. await
169
169
. expect ( "Could not verify auction" ) ;
170
170
let auction_accounts = initial_offer_placed_state. auction_accounts ;
Original file line number Diff line number Diff line change @@ -143,8 +143,7 @@ pub fn initialize_program_instruction(
143
143
) -> Instruction {
144
144
let program_id = testing_context. get_matching_engine_program_id ( ) ;
145
145
let usdc_mint_address = testing_context. get_usdc_mint_address ( ) ;
146
- let initialize_addresses =
147
- InitializeAddresses :: new ( testing_context, & auction_parameters_config) ;
146
+ let initialize_addresses = InitializeAddresses :: new ( testing_context, auction_parameters_config) ;
148
147
let InitializeAddresses {
149
148
custodian_address : custodian,
150
149
auction_config_address : auction_config,
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ pub async fn place_initial_offer_shimless(
275
275
auction_state
276
276
. get_active_auction ( )
277
277
. unwrap ( )
278
- . verify_auction ( & testing_context, test_context)
278
+ . verify_auction ( testing_context, test_context)
279
279
. await
280
280
. expect ( "Could not verify auction state" ) ;
281
281
return TestingEngineState :: InitialOfferPlaced {
@@ -413,7 +413,7 @@ pub async fn improve_offer(
413
413
new_auction_state
414
414
. get_active_auction ( )
415
415
. unwrap ( )
416
- . verify_auction ( & testing_context, test_context)
416
+ . verify_auction ( testing_context, test_context)
417
417
. await
418
418
. expect ( "Could not verify auction state" ) ;
419
419
return TestingEngineState :: OfferImproved {
Original file line number Diff line number Diff line change @@ -624,6 +624,7 @@ pub struct BalanceChange {
624
624
pub usdt : i32 ,
625
625
}
626
626
627
+ #[ derive( Default ) ]
627
628
pub struct CombinedInstructionConfig {
628
629
pub create_fast_market_order_config : Option < InitializeFastMarketOrderShimInstructionConfig > ,
629
630
pub place_initial_offer_config : Option < PlaceInitialOfferInstructionConfig > ,
@@ -633,19 +634,6 @@ pub struct CombinedInstructionConfig {
633
634
pub improve_offer_config : Option < ImproveOfferInstructionConfig > ,
634
635
}
635
636
636
- impl Default for CombinedInstructionConfig {
637
- fn default ( ) -> Self {
638
- Self {
639
- create_fast_market_order_config : None ,
640
- place_initial_offer_config : None ,
641
- execute_order_config : None ,
642
- settle_auction_config : None ,
643
- close_fast_market_order_config : None ,
644
- improve_offer_config : None ,
645
- }
646
- }
647
- }
648
-
649
637
impl CombinedInstructionConfig {
650
638
pub fn create_fast_market_order_and_place_initial_offer (
651
639
testing_actors : & TestingActors ,
Original file line number Diff line number Diff line change @@ -98,7 +98,6 @@ impl Deref for TestRouterEndpoints {
98
98
}
99
99
100
100
impl TestRouterEndpoints {
101
-
102
101
pub fn get_from_and_to_endpoint_addresses (
103
102
& self ,
104
103
transfer_direction : TransferDirection ,
Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ pub fn burn_and_post<'info>(
53
53
payer,
54
54
wormhole_program_id : & CORE_BRIDGE_PROGRAM_ID ,
55
55
derived : post_message:: PostMessageDerivedAccounts {
56
- message : Some ( & message) ,
57
- sequence : Some ( & sequence) ,
56
+ message : Some ( message) ,
57
+ sequence : Some ( sequence) ,
58
58
core_bridge_config : Some ( & CORE_BRIDGE_CONFIG ) ,
59
59
fee_collector : Some ( & CORE_BRIDGE_FEE_COLLECTOR ) ,
60
60
event_authority : Some ( & POST_MESSAGE_SHIM_EVENT_AUTHORITY ) ,
Original file line number Diff line number Diff line change @@ -128,15 +128,19 @@ pub fn try_fast_market_order_account<'a>(
128
128
return Err ( ErrorCode :: AccountDiscriminatorNotFound . into ( ) ) ;
129
129
}
130
130
131
- if & data[ 0 ..8 ] != & FastMarketOrder :: DISCRIMINATOR {
131
+ if data[ 0 ..8 ] != FastMarketOrder :: DISCRIMINATOR {
132
132
return Err ( ErrorCode :: AccountDiscriminatorMismatch . into ( ) ) ;
133
133
}
134
134
135
135
// TODO: Move up?
136
136
super :: helpers:: require_owned_by_this_program ( fast_market_order_info, "fast_market_order" ) ?;
137
137
138
138
Ok ( Ref :: map ( data, |data| {
139
- bytemuck:: from_bytes ( & data[ 8 ..8 + std:: mem:: size_of :: < FastMarketOrder > ( ) ] )
139
+ bytemuck:: from_bytes (
140
+ & data[ 8 ..8_usize
141
+ . checked_add ( std:: mem:: size_of :: < FastMarketOrder > ( ) )
142
+ . unwrap ( ) ] ,
143
+ )
140
144
} ) )
141
145
}
142
146
Original file line number Diff line number Diff line change @@ -403,7 +403,7 @@ pub fn prepare_order_response_cctp_shim(
403
403
& spl_token:: ID ,
404
404
& CCTP_MINT_RECIPIENT ,
405
405
& expected_prepared_custody_key,
406
- & custodian_info. key ,
406
+ custodian_info. key ,
407
407
& [ ] , // Apparently this is only for multi-sig accounts
408
408
amount_in,
409
409
)
Original file line number Diff line number Diff line change @@ -102,7 +102,8 @@ impl FallbackMatchingEngineInstruction<'_> {
102
102
match self {
103
103
Self :: InitializeFastMarketOrder ( data) => {
104
104
let mut out = Vec :: with_capacity (
105
- SELECTOR_SIZE + std:: mem:: size_of :: < InitializeFastMarketOrderData > ( ) ,
105
+ SELECTOR_SIZE
106
+ . saturating_add ( std:: mem:: size_of :: < InitializeFastMarketOrderData > ( ) ) ,
106
107
) ;
107
108
108
109
out. extend_from_slice (
@@ -113,7 +114,10 @@ impl FallbackMatchingEngineInstruction<'_> {
113
114
out
114
115
}
115
116
Self :: PlaceInitialOfferCctpShim ( data) => {
116
- let mut out = Vec :: with_capacity ( SELECTOR_SIZE + std:: mem:: size_of :: < u64 > ( ) ) ;
117
+ let mut out = Vec :: with_capacity (
118
+ SELECTOR_SIZE
119
+ . saturating_add ( std:: mem:: size_of :: < PlaceInitialOfferCctpShimData > ( ) ) ,
120
+ ) ;
117
121
118
122
out. extend_from_slice (
119
123
& FallbackMatchingEngineInstruction :: PLACE_INITIAL_OFFER_CCTP_SHIM_SELECTOR ,
You can’t perform that action at this time.
0 commit comments