Skip to content

Commit 6226414

Browse files
committed
removed 3 accounts and renamed accounts struct
1 parent e47fcd8 commit 6226414

File tree

2 files changed

+8
-26
lines changed

2 files changed

+8
-26
lines changed

solana/modules/matching-engine-testing/tests/shimful/shims_execute_order.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use common::wormhole_cctp_solana::cctp::{
88
MESSAGE_TRANSMITTER_PROGRAM_ID, TOKEN_MESSENGER_MINTER_PROGRAM_ID,
99
};
1010
use matching_engine::accounts::CctpDepositForBurn;
11-
use matching_engine::fallback::execute_order::{ExecuteOrderCctpShim, ExecuteOrderShimAccounts};
11+
use matching_engine::fallback::execute_order::{ExecuteOrderCctpShim, ExecuteOrderV2Accounts};
1212
use solana_program_test::ProgramTestContext;
1313
use solana_sdk::{pubkey::Pubkey, signer::Signer, sysvar::SysvarId};
1414
use utils::constants::*;
@@ -261,8 +261,8 @@ fn create_order_executed_state(
261261
fn create_execute_order_shim_accounts<'ix>(
262262
execute_order_fallback_accounts: &'ix ExecuteOrderShimfulAccounts,
263263
clock_id: &'ix Pubkey,
264-
) -> ExecuteOrderShimAccounts<'ix> {
265-
ExecuteOrderShimAccounts {
264+
) -> ExecuteOrderV2Accounts<'ix> {
265+
ExecuteOrderV2Accounts {
266266
payer: &execute_order_fallback_accounts.signer, // 0
267267
new_cctp_message: &execute_order_fallback_accounts.cctp_message, // 1
268268
custodian: &execute_order_fallback_accounts.custodian, // 2
@@ -297,9 +297,6 @@ fn create_execute_order_shim_accounts<'ix>(
297297
core_bridge_config: &CORE_BRIDGE_CONFIG, // 26
298298
core_bridge_fee_collector: &CORE_BRIDGE_FEE_COLLECTOR, // 27
299299
post_message_shim_event_authority: &POST_MESSAGE_SHIM_EVENT_AUTHORITY, // 28
300-
system_program: &solana_program::system_program::ID, // 29
301-
token_program: &spl_token::ID, // 30
302-
clock: clock_id, // 31
303300
}
304301
}
305302

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

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ use super::burn_and_post::{burn_and_post, PostMessageAccounts};
1818

1919
const NUM_ACCOUNTS: usize = 32;
2020

21-
// TODO: Rename to "ExecuteOrderCctpV2Accounts".
2221
#[derive(Debug, Clone, PartialEq, Eq, Copy)]
23-
pub struct ExecuteOrderShimAccounts<'ix> {
22+
pub struct ExecuteOrderV2Accounts<'ix> {
2423
/// The signer account.
2524
pub payer: &'ix Pubkey, // 0
2625
/// The cctp message account. Seeds must be \["cctp-msg", auction_address.as_ref()\].
@@ -78,26 +77,18 @@ pub struct ExecuteOrderShimAccounts<'ix> {
7877
pub core_bridge_fee_collector: &'ix Pubkey, // 27
7978
/// The event authority account of the post message shim program
8079
pub post_message_shim_event_authority: &'ix Pubkey, // 28
81-
/// The program id of the system program
82-
// TODO: Remove.
83-
pub system_program: &'ix Pubkey, // 29
84-
/// The program id of the token program
85-
// TODO: Remove.
86-
pub token_program: &'ix Pubkey, // 30
87-
/// The clock account
88-
// TODO: Remove.
89-
pub clock: &'ix Pubkey, // 31
9080
}
81+
9182

9283
// TODO: Rename to "ExecuteOrderCctpV2".
9384
pub struct ExecuteOrderCctpShim<'ix> {
9485
pub program_id: &'ix Pubkey,
95-
pub accounts: ExecuteOrderShimAccounts<'ix>,
86+
pub accounts: ExecuteOrderV2Accounts<'ix>,
9687
}
9788

9889
impl ExecuteOrderCctpShim<'_> {
9990
pub fn instruction(&self) -> Instruction {
100-
let ExecuteOrderShimAccounts {
91+
let ExecuteOrderV2Accounts {
10192
payer,
10293
new_cctp_message,
10394
custodian,
@@ -130,9 +121,6 @@ impl ExecuteOrderCctpShim<'_> {
130121
core_bridge_config,
131122
core_bridge_fee_collector,
132123
post_message_shim_event_authority,
133-
system_program: _,
134-
token_program: _,
135-
clock: _,
136124
} = self.accounts;
137125

138126
let accounts = vec![
@@ -470,7 +458,7 @@ mod test {
470458
fn test_instruction() {
471459
ExecuteOrderCctpShim {
472460
program_id: &Default::default(),
473-
accounts: ExecuteOrderShimAccounts {
461+
accounts: ExecuteOrderV2Accounts {
474462
payer: &Default::default(),
475463
new_cctp_message: &Default::default(),
476464
custodian: &Default::default(),
@@ -500,9 +488,6 @@ mod test {
500488
core_bridge_config: &Default::default(),
501489
core_bridge_fee_collector: &Default::default(),
502490
post_message_shim_event_authority: &Default::default(),
503-
system_program: &Default::default(),
504-
token_program: &Default::default(),
505-
clock: &Default::default(),
506491
},
507492
}
508493
.instruction();

0 commit comments

Comments
 (0)