Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/solana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,23 @@ jobs:
- name: make anchor-test-upgrade
run: make anchor-test-upgrade
working-directory: ./solana
make-test-sbf:
name: make test-sbf
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTC_VERSION }}
- name: Git Submodule Update
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git submodule update --init --recursive
working-directory: ./solana
- name: make test-sbf
run: make test-sbf
working-directory: ./solana
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,25 @@ pub async fn test_settle_auction_none_balance_changes_comparable() {
helpers::compare_balance_changes(&balance_changes_shimful, &balance_changes_shimless);
}

/// Test that settle auction none closes the prepared order account and the custody token account
#[tokio::test]
pub async fn test_settle_auction_none_closes_prepared_order_account_and_custody_token_account() {
let (mut test_context, prepared_order_state, testing_engine, _initial_balances) =
Box::pin(helpers::prepare_settle_auction_none_shimful()).await;
let instruction_triggers = vec![InstructionTrigger::SettleAuctionNoneShim(
SettleAuctionNoneInstructionConfig::default(),
)];
let settle_auction_none_state = testing_engine
.execute(
&mut test_context,
instruction_triggers,
Some(prepared_order_state),
)
.await;
helpers::verify_prepared_order_accounts_closed(&settle_auction_none_state, &mut test_context)
.await;
}

/*
Sad path tests section

Expand Down Expand Up @@ -435,6 +454,25 @@ mod helpers {

use super::*;

pub async fn verify_prepared_order_accounts_closed(
testing_state: &TestingEngineState,
test_context: &mut ProgramTestContext,
) {
let prepared_order_accounts = testing_state.order_prepared().unwrap();
let prepared_order_account = test_context
.banks_client
.get_account(prepared_order_accounts.prepared_custody_token)
.await
.unwrap();
assert!(prepared_order_account.is_none());
let prepared_custody_token_account = test_context
.banks_client
.get_account(prepared_order_accounts.prepared_custody_token)
.await
.unwrap();
assert!(prepared_custody_token_account.is_none());
}

pub async fn balance_changes_shim() -> BalanceChanges {
let transfer_direction = TransferDirection::FromEthereumToArbitrum;
let vaa_args = vec![VaaArgs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub(super) fn process(
// Create the new fast market order account and serialize the instruction
// data into it.

let new_fast_market_order_info = &accounts[1];
let new_fast_market_order_info = &accounts[5];
let (expected_fast_market_order_key, fast_market_order_bump) = Pubkey::find_program_address(
&[
FastMarketOrder::SEED_PREFIX,
Expand Down
Loading