Skip to content

Commit 253c573

Browse files
Bengt Lofgrena5-pickle
authored andcommitted
creating a helper function for settle_none_prepare_fill
1 parent 823ec88 commit 253c573

File tree

6 files changed

+321
-384
lines changed

6 files changed

+321
-384
lines changed

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

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
use anchor_lang::prelude::*;
22
use anchor_spl::token::spl_token;
33
use matching_engine::{
4-
fallback::{
5-
settle_auction_none_cctp::{
6-
SettleAuctionNoneCctpShimAccounts, SettleAuctionNoneCctpShimData,
7-
},
8-
FallbackMatchingEngineInstruction,
4+
fallback::settle_auction_none_cctp::{
5+
SettleAuctionNoneCctpShim, SettleAuctionNoneCctpShimAccounts, SettleAuctionNoneCctpShimData,
96
},
107
state::Auction,
118
};
12-
use solana_program::instruction::Instruction;
139
use solana_program_test::ProgramTestContext;
1410
use solana_sdk::{signature::Signer, sysvar::SysvarId, transaction::Transaction};
1511
use wormhole_svm_definitions::solana::{
@@ -30,22 +26,6 @@ use crate::{
3026

3127
use super::shims_execute_order::{create_cctp_accounts, CctpAccounts};
3228

33-
pub struct SettleAuctionNoneCctpShim<'ix> {
34-
pub program_id: &'ix Pubkey,
35-
pub accounts: SettleAuctionNoneCctpShimAccounts<'ix>,
36-
pub data: SettleAuctionNoneCctpShimData,
37-
}
38-
39-
impl SettleAuctionNoneCctpShim<'_> {
40-
pub fn instruction(self) -> Instruction {
41-
Instruction {
42-
program_id: *self.program_id,
43-
accounts: self.accounts.to_account_metas(),
44-
data: FallbackMatchingEngineInstruction::SettleAuctionNoneCctpShim(&self.data).to_vec(),
45-
}
46-
}
47-
}
48-
4929
pub async fn settle_auction_none_shimful(
5030
testing_context: &TestingContext,
5131
test_context: &mut ProgramTestContext,
@@ -170,7 +150,7 @@ fn create_settle_auction_none_cctp_shimful_accounts(
170150
let OrderPreparedState {
171151
prepared_order_response_address,
172152
prepared_custody_token,
173-
base_fee_token,
153+
base_fee_token: _,
174154
actor_enum: _,
175155
prepared_by,
176156
} = *order_prepared_state;

solana/programs/matching-engine/src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ pub enum MatchingEngineError {
8686
BaseFeeTokenRequired = 0x43e,
8787

8888
CannotCloseAuctionYet = 0x500,
89+
InvalidFeeRecipientToken = 0x501,
8990
AuctionHistoryNotFull = 0x502,
9091
AuctionHistoryFull = 0x504,
9192

0 commit comments

Comments
 (0)