Skip to content

Commit d809147

Browse files
author
Bengt Lofgren
committed
make lint
1 parent 48340d7 commit d809147

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

solana/programs/matching-engine/src/fallback/processor/execute_order.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ pub fn handle_execute_order_shim(accounts: &[AccountInfo]) -> Result<()> {
442442
let fast_market_order_data = &fast_market_order_account.data.borrow()[8..];
443443
// Deserialise fast market order. Unwrap is safe because the account is owned by the matching engine program.
444444
let fast_market_order =
445-
bytemuck::try_from_bytes::<FastMarketOrderState>(&fast_market_order_data[..]).unwrap();
445+
bytemuck::try_from_bytes::<FastMarketOrderState>(fast_market_order_data).unwrap();
446446

447447
// Prepare the execute order (get the user amount, fill, and order executed event)
448448
let active_auction_info = active_auction.info.as_ref().unwrap();
@@ -639,7 +639,7 @@ pub fn handle_execute_order_shim(accounts: &[AccountInfo]) -> Result<()> {
639639
order_sender: fast_market_order.sender,
640640
redeemer: fast_market_order.redeemer,
641641
redeemer_message: fast_market_order.redeemer_message
642-
[..fast_market_order.redeemer_message_length as usize]
642+
[..usize::from(fast_market_order.redeemer_message_length)]
643643
.to_vec()
644644
.try_into()
645645
.unwrap(),
@@ -690,7 +690,7 @@ pub fn handle_execute_order_shim(accounts: &[AccountInfo]) -> Result<()> {
690690
common::wormhole_cctp_solana::cpi::BurnAndPublishArgs {
691691
burn_source: None,
692692
destination_caller: to_router_endpoint.address,
693-
destination_cctp_domain: destination_cctp_domain,
693+
destination_cctp_domain,
694694
amount: user_amount,
695695
mint_recipient: to_router_endpoint.mint_recipient,
696696
wormhole_message_nonce: common::WORMHOLE_MESSAGE_NONCE,

solana/programs/matching-engine/tests/shimful/shims_execute_order.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ impl ExecuteOrderFallbackAccounts {
5858
};
5959

6060
Self {
61-
signer: signer.clone(),
61+
signer: *signer,
6262
custodian: auction_accounts.custodian,
63-
fast_market_order_address: fast_market_order_address.clone(),
63+
fast_market_order_address: *fast_market_order_address,
6464
active_auction: active_auction_state.auction_address,
6565
active_auction_custody_token: active_auction_state.auction_custody_token_address,
6666
active_auction_config: auction_accounts.auction_config,
6767
active_auction_best_offer_token: auction_accounts.offer_token,
6868
initial_offer_token: auction_accounts.offer_token,
69-
initial_participant: signer.clone(),
69+
initial_participant: *signer,
7070
to_router_endpoint: auction_accounts.to_router_endpoint,
7171
remote_token_messenger,
7272
token_messenger: fixture_accounts.token_messenger,
@@ -162,7 +162,7 @@ pub async fn execute_order_fallback(
162162
cctp_deposit_for_burn_token_minter: &token_minter, // 20
163163
cctp_deposit_for_burn_local_token: &local_token, // 21
164164
cctp_deposit_for_burn_token_messenger_minter_event_authority:
165-
&token_messenger_minter_event_authority, // 22
165+
token_messenger_minter_event_authority, // 22
166166
cctp_deposit_for_burn_token_messenger_minter_program: &TOKEN_MESSENGER_MINTER_PROGRAM_ID, // 23
167167
cctp_deposit_for_burn_message_transmitter_program: &MESSAGE_TRANSMITTER_PROGRAM_ID, // 24
168168
core_bridge_program: &CORE_BRIDGE_PROGRAM_ID, // 25
@@ -175,14 +175,14 @@ pub async fn execute_order_fallback(
175175
};
176176

177177
let execute_order_ix = ExecuteOrderCctpShim {
178-
program_id: program_id,
178+
program_id,
179179
accounts: execute_order_ix_accounts,
180180
}
181181
.instruction();
182182

183183
// Considering fast forwarding blocks here for deadline to be reached
184184
let recent_blockhash = test_ctx.borrow().last_blockhash;
185-
utils::setup::fast_forward_slots(&testing_context, 3).await;
185+
utils::setup::fast_forward_slots(testing_context, 3).await;
186186
let transaction = Transaction::new_signed_with_payer(
187187
&[execute_order_ix],
188188
Some(&payer_signer.pubkey()),
@@ -230,7 +230,7 @@ pub async fn execute_order_fallback_test(
230230
testing_context.testing_state.transfer_direction,
231231
);
232232
execute_order_fallback(
233-
&testing_context,
233+
testing_context,
234234
&testing_context.testing_actors.owner.keypair(),
235235
&testing_context.get_matching_engine_program_id(),
236236
solver,

solana/programs/matching-engine/tests/shimless/execute_order.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn create_execute_order_shimless_accounts(
5757
};
5858
let wormhole_publish_message = WormholePublishMessage {
5959
config: wormhole_svm_definitions::solana::CORE_BRIDGE_CONFIG,
60-
emitter_sequence: emitter_sequence,
60+
emitter_sequence,
6161
fee_collector: wormhole_svm_definitions::solana::CORE_BRIDGE_FEE_COLLECTOR,
6262
core_bridge_program: wormhole_svm_definitions::solana::CORE_BRIDGE_PROGRAM_ID,
6363
};
@@ -158,7 +158,7 @@ pub async fn execute_order_shimless_test(
158158
payer_signer: &Rc<Keypair>,
159159
expected_error: Option<&ExpectedError>,
160160
) -> Option<ExecuteOrderShimlessFixture> {
161-
crate::utils::setup::fast_forward_slots(&testing_context, 3).await;
161+
crate::utils::setup::fast_forward_slots(testing_context, 3).await;
162162
let fixture_accounts = testing_context
163163
.get_fixture_accounts()
164164
.expect("Fixture accounts not found");

solana/programs/matching-engine/tests/testing_engine/engine.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,21 +536,21 @@ impl TestingEngine {
536536
let auction_accounts = current_state
537537
.auction_accounts()
538538
.expect("Auction accounts not found");
539-
let fast_market_order_address = config.fast_market_order_address.unwrap_or(
539+
let fast_market_order_address = config.fast_market_order_address.unwrap_or_else(|| {
540540
current_state
541541
.fast_market_order()
542542
.expect("Fast market order is not created")
543-
.fast_market_order_address,
544-
);
543+
.fast_market_order_address
544+
});
545545
let active_auction_state = current_state
546546
.auction_state()
547547
.get_active_auction()
548548
.expect("Active auction not found");
549549
let result = shimful::shims_execute_order::execute_order_fallback_test(
550550
&self.testing_context,
551-
&auction_accounts,
551+
auction_accounts,
552552
&fast_market_order_address,
553-
&active_auction_state,
553+
active_auction_state,
554554
solver,
555555
config.expected_error.as_ref(),
556556
)
@@ -584,7 +584,7 @@ impl TestingEngine {
584584
let payer_signer = config
585585
.payer_signer
586586
.clone()
587-
.unwrap_or(self.testing_context.testing_actors.owner.keypair());
587+
.unwrap_or_else(|| self.testing_context.testing_actors.owner.keypair());
588588
let auction_config_address = current_state
589589
.auction_config_address()
590590
.expect("Auction config address not found");

0 commit comments

Comments
 (0)