diff --git a/.github/workflows/integration-reusable.yml b/.github/workflows/integration-reusable.yml index cd09f57d29..be5f1be8d7 100644 --- a/.github/workflows/integration-reusable.yml +++ b/.github/workflows/integration-reusable.yml @@ -12,6 +12,9 @@ on: build_token_metadata: required: true type: boolean + changes: + required: true + type: boolean env: CARGO_TERM_COLOR: always @@ -47,6 +50,7 @@ jobs: runs-on: buildjet-8vcpu-ubuntu-2004 needs: changes if: | + inputs.changes == false || needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' || needs.changes.outputs.workflow == 'true' diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8f9e4a2324..e7d759c0ac 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -10,8 +10,12 @@ on: inputs: cache: description: 'Use Cached Dependencies' - required: false - default: true + required: true + type: boolean + changes: + description: 'Only run when files change' + required: true + type: boolean jobs: integration-tests: @@ -21,15 +25,11 @@ jobs: matrix: node: - name: "fixed-price-sale" - build_token_metadata: true - name: "hydra" - build_token_metadata: true - name: "candy-machine-core" - build_token_metadata: true uses: ./.github/workflows/integration-reusable.yml with: name: ${{ matrix.node.name }} - build_token_metadata: ${{ matrix.node.build_token_metadata }} - cache: ${{ (github.event_name == 'workflow_dispatch' && github.event.workflow_dispatch.inputs.cache == 'true') || - (github.event_name != 'workflow_dispatch' && false) }} -# CHANGE `&& false` to `&& true` to default the workflow to use caching. + build_token_metadata: ${{ !contains(matrix.node.build_token_metadata, 'false') }} + cache: ${{ contains(inputs.cache, 'true') }} + changes: ${{ !contains(inputs.changes, 'false') }} diff --git a/.github/workflows/program-reusable.yml b/.github/workflows/program-reusable.yml index 855acb44e3..185040154a 100644 --- a/.github/workflows/program-reusable.yml +++ b/.github/workflows/program-reusable.yml @@ -6,13 +6,10 @@ on: name: required: true type: string - verify_rust: - required: true - type: boolean - cargo_test: + cache: required: true type: boolean - cache: + changes: required: true type: boolean @@ -61,6 +58,7 @@ jobs: runs-on: buildjet-8vcpu-ubuntu-2204 needs: changes if: | + inputs.changes == false || needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' || needs.changes.outputs.workflow == 'true' || @@ -90,7 +88,6 @@ jobs: if: ${{ env.CACHE != 'false' }} # Run lint checks - uses: ./.github/actions/verify-rust - if: ${{ inputs.verify_rust }} with: working-directory: ./${{ inputs.name }}/program @@ -103,7 +100,6 @@ jobs: - name: "Cargo Test: ${{ inputs.name }}" working-directory: ./${{ inputs.name }}/program run: cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1 - if: ${{ inputs.cargo_test }} # Run BPF Test - name: "BPF Test: ${{ inputs.name }}" diff --git a/.github/workflows/program.yml b/.github/workflows/program.yml index 32aa49ee6d..48740507d4 100644 --- a/.github/workflows/program.yml +++ b/.github/workflows/program.yml @@ -10,8 +10,12 @@ on: inputs: cache: description: 'Use Cached Dependencies' - required: false - default: true + required: true + type: boolean + changes: + description: 'Only run when files change' + required: true + type: boolean jobs: program-tests: @@ -20,42 +24,19 @@ jobs: fail-fast: false matrix: node: - - name: "auction-house" - verify_rust: true - cargo_test: true - name: "auctioneer" - verify_rust: true - cargo_test: true - name: "bubblegum" - verify_rust: false - cargo_test: false - name: "candy-machine" - verify_rust: true - cargo_test: true + - name: "auction-house" - name: "fixed-price-sale" - verify_rust: false - cargo_test: false - name: "gumdrop" - verify_rust: false - cargo_test: true - name: "hydra" - verify_rust: true - cargo_test: true - name: "nft-packs" - verify_rust: false - cargo_test: false - name: "token-entangler" - verify_rust: true - cargo_test: true - name: "token-metadata" - verify_rust: true - cargo_test: true uses: ./.github/workflows/program-reusable.yml with: name: ${{ matrix.node.name }} - verify_rust: ${{ matrix.node.verify_rust }} - cargo_test: ${{ matrix.node.cargo_test }} - cache: ${{ (github.event_name == 'workflow_dispatch' && github.event.workflow_dispatch.inputs.cache == 'true') || - (github.event_name != 'workflow_dispatch' && false) }} -# CHANGE `&& false` to `&& true` to default the workflow to use caching. + cache: ${{ contains(inputs.cache, 'true') }} + changes: ${{ !contains(inputs.changes, 'false') }} diff --git a/.github/workflows/sdk-reusable.yml b/.github/workflows/sdk-reusable.yml index 1b95780945..8778f07a55 100644 --- a/.github/workflows/sdk-reusable.yml +++ b/.github/workflows/sdk-reusable.yml @@ -12,6 +12,9 @@ on: cache: required: true type: boolean + changes: + required: true + type: boolean env: CARGO_TERM_COLOR: always @@ -46,6 +49,7 @@ jobs: name: Build Lint and Test needs: changes if: | + inputs.changes == false || needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' || needs.changes.outputs.workflow == 'true' diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index 1838d65e55..4d375f0f48 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -10,8 +10,12 @@ on: inputs: cache: description: 'Use Cached Dependencies' - required: false - default: true + required: true + type: boolean + changes: + description: 'Only run when files change' + required: true + type: boolean jobs: sdk-tests: @@ -21,30 +25,23 @@ jobs: matrix: node: - name: "auction-house" - skip_test: false - name: "candy-machine" - skip_test: false - name: "candy-machine-core" skip_test: true - name: "core" - skip_test: false - name: "fixed-price-sale" skip_test: true - name: "gumdrop" - skip_test: false - name: "hydra" skip_test: true - name: "nft-packs" skip_test: true - name: "token-entangler" - skip_test: false - name: "token-metadata" - skip_test: false uses: ./.github/workflows/sdk-reusable.yml with: name: ${{ matrix.node.name }} - skip_test: ${{ matrix.node.skip_test }} - cache: ${{ (github.event_name == 'workflow_dispatch' && github.event.workflow_dispatch.inputs.cache == 'true') || - (github.event_name != 'workflow_dispatch' && false) }} -# CHANGE `&& false` to `&& true` to default the workflow to use caching. + skip_test: ${{ contains(matrix.node.skip_test, 'true') }} + cache: ${{ contains(inputs.cache, 'true') }} + changes: ${{ !contains(inputs.changes, 'false') }} diff --git a/bubblegum/program/Cargo.toml b/bubblegum/program/Cargo.toml index 6d124daee3..17a50c0364 100644 --- a/bubblegum/program/Cargo.toml +++ b/bubblegum/program/Cargo.toml @@ -16,6 +16,7 @@ no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] +test-bpf = [] default = [] [dependencies] diff --git a/bubblegum/program/tests/simple.rs b/bubblegum/program/tests/simple.rs index d745e663fc..7417c95477 100644 --- a/bubblegum/program/tests/simple.rs +++ b/bubblegum/program/tests/simple.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] pub mod utils; use anchor_lang::solana_program::instruction::InstructionError; diff --git a/fixed-price-sale/program/src/state.rs b/fixed-price-sale/program/src/state.rs index c375c0d658..4e6020ed1e 100644 --- a/fixed-price-sale/program/src/state.rs +++ b/fixed-price-sale/program/src/state.rs @@ -122,7 +122,6 @@ pub struct PrimaryMetadataCreators { pub creators: Vec, } - pub fn from_mpl_creators(creators: Vec) -> Vec { creators .iter() diff --git a/gumdrop/program/src/lib.rs b/gumdrop/program/src/lib.rs index 1c383bc73b..7622702b8f 100644 --- a/gumdrop/program/src/lib.rs +++ b/gumdrop/program/src/lib.rs @@ -1484,4 +1484,4 @@ pub struct CandyMachineData { pub price: u64, pub items_available: u64, pub go_live_date: Option, -} \ No newline at end of file +} diff --git a/gumdrop/program/src/merkle_proof.rs b/gumdrop/program/src/merkle_proof.rs index 92bf39df51..e857711c2e 100644 --- a/gumdrop/program/src/merkle_proof.rs +++ b/gumdrop/program/src/merkle_proof.rs @@ -10,10 +10,12 @@ pub fn verify(proof: Vec<[u8; 32]>, root: [u8; 32], leaf: [u8; 32]) -> bool { for proof_element in proof.into_iter() { if computed_hash <= proof_element { // Hash(current computed hash + current element of the proof) - computed_hash = solana_program::keccak::hashv(&[&[0x01], &computed_hash, &proof_element]).0; + computed_hash = + solana_program::keccak::hashv(&[&[0x01], &computed_hash, &proof_element]).0; } else { // Hash(current element of the proof + current computed hash) - computed_hash = solana_program::keccak::hashv(&[&[0x01], &proof_element, &computed_hash]).0; + computed_hash = + solana_program::keccak::hashv(&[&[0x01], &proof_element, &computed_hash]).0; } } // Check if the computed hash (root) is equal to the provided root diff --git a/nft-packs/program/src/processor/add_card_to_pack.rs b/nft-packs/program/src/processor/add_card_to_pack.rs index 0cfdffa6f8..34a8397175 100644 --- a/nft-packs/program/src/processor/add_card_to_pack.rs +++ b/nft-packs/program/src/processor/add_card_to_pack.rs @@ -217,8 +217,6 @@ pub fn get_pack_config_data<'a>( ) -> Result { let unpack = PackConfig::unpack(&account_info.data.borrow_mut()); - - match unpack { Ok(data) => Ok(data), Err(_) => { diff --git a/nft-packs/program/src/processor/request_card_to_redeem.rs b/nft-packs/program/src/processor/request_card_to_redeem.rs index b825de1fdc..63445373c0 100644 --- a/nft-packs/program/src/processor/request_card_to_redeem.rs +++ b/nft-packs/program/src/processor/request_card_to_redeem.rs @@ -254,8 +254,6 @@ pub fn get_proving_process_data<'a>( ) -> Result { let unpack = ProvingProcess::unpack(&account_info.data.borrow_mut()); - - match unpack { Ok(data) => Ok(data), Err(_) => { diff --git a/nft-packs/program/src/state/pack_card.rs b/nft-packs/program/src/state/pack_card.rs index 5c00c8839e..c5ecf3fa04 100644 --- a/nft-packs/program/src/state/pack_card.rs +++ b/nft-packs/program/src/state/pack_card.rs @@ -14,7 +14,15 @@ use solana_program::{ /// Pack card #[repr(C)] #[derive( - Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize, BorshSchema, Default, ShankAccount, + Debug, + Clone, + PartialEq, + Eq, + BorshSerialize, + BorshDeserialize, + BorshSchema, + Default, + ShankAccount, )] pub struct PackCard { /// Account type - PackCard diff --git a/nft-packs/program/src/state/pack_set.rs b/nft-packs/program/src/state/pack_set.rs index 0bc57281e3..bea7313ad4 100644 --- a/nft-packs/program/src/state/pack_set.rs +++ b/nft-packs/program/src/state/pack_set.rs @@ -57,7 +57,15 @@ impl Default for PackDistributionType { /// Pack set #[repr(C)] #[derive( - Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize, BorshSchema, Default, ShankAccount, + Debug, + Clone, + PartialEq, + Eq, + BorshSerialize, + BorshDeserialize, + BorshSchema, + Default, + ShankAccount, )] pub struct PackSet { /// Account type - PackSet diff --git a/nft-packs/program/src/state/pack_voucher.rs b/nft-packs/program/src/state/pack_voucher.rs index 001e253462..bb7123cebb 100644 --- a/nft-packs/program/src/state/pack_voucher.rs +++ b/nft-packs/program/src/state/pack_voucher.rs @@ -13,7 +13,15 @@ use solana_program::{ /// Pack voucher #[repr(C)] #[derive( - Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize, BorshSchema, Default, ShankAccount, + Debug, + Clone, + PartialEq, + Eq, + BorshSerialize, + BorshDeserialize, + BorshSchema, + Default, + ShankAccount, )] pub struct PackVoucher { /// Account type - PackVoucher diff --git a/nft-packs/program/tests/activate.rs b/nft-packs/program/tests/activate.rs index 3a16f87d42..a6a9b28ad5 100644 --- a/nft-packs/program/tests/activate.rs +++ b/nft-packs/program/tests/activate.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ diff --git a/nft-packs/program/tests/add_card_to_pack.rs b/nft-packs/program/tests/add_card_to_pack.rs index 0272fb9395..427a93a175 100644 --- a/nft-packs/program/tests/add_card_to_pack.rs +++ b/nft-packs/program/tests/add_card_to_pack.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ diff --git a/nft-packs/program/tests/add_voucher_to_pack.rs b/nft-packs/program/tests/add_voucher_to_pack.rs index ec638f0b9e..8989da5b16 100644 --- a/nft-packs/program/tests/add_voucher_to_pack.rs +++ b/nft-packs/program/tests/add_voucher_to_pack.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ diff --git a/nft-packs/program/tests/claim_card.rs b/nft-packs/program/tests/claim_card.rs index 8b8bebcd0a..a36af931da 100644 --- a/nft-packs/program/tests/claim_card.rs +++ b/nft-packs/program/tests/claim_card.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ @@ -932,27 +933,28 @@ async fn success_claim_two_indexes() { let proving_process_data = get_account(&mut context, &proving_process_key).await; let proving_process = ProvingProcess::unpack_from_slice(&proving_process_data.data).unwrap(); + let (index, _value) = proving_process + .cards_to_redeem + .into_iter() + .next() + .expect("Cards to redeem shouldn't be empty!"); - for (index, _value) in proving_process.cards_to_redeem { - test_pack_set - .claim_pack( - &mut context, - &edition_authority, - &voucher_edition.mint.pubkey(), - &test_pack_card.token_account.pubkey(), - &card_master_edition.pubkey, - &new_mint, - &new_mint_token_acc, - &edition_authority, - &card_metadata.pubkey, - &card_master_edition.mint_pubkey, - index, - ) - .await - .unwrap(); - - break; - } + test_pack_set + .claim_pack( + &mut context, + &edition_authority, + &voucher_edition.mint.pubkey(), + &test_pack_card.token_account.pubkey(), + &card_master_edition.pubkey, + &new_mint, + &new_mint_token_acc, + &edition_authority, + &card_metadata.pubkey, + &card_master_edition.mint_pubkey, + index, + ) + .await + .unwrap(); let card_master_edition = card_master_edition.get_data(&mut context).await; let card_master_edition1 = card_master_edition1.get_data(&mut context).await; diff --git a/nft-packs/program/tests/clean_up.rs b/nft-packs/program/tests/clean_up.rs index 1c8a33a9fc..3ec1d0ce8b 100644 --- a/nft-packs/program/tests/clean_up.rs +++ b/nft-packs/program/tests/clean_up.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ @@ -168,19 +169,16 @@ async fn success_clean_up_change() { let pack_config_account = get_account(&mut context, &pack_config_key).await; let pack_config = PackConfig::unpack_from_slice(&pack_config_account.data).unwrap(); - assert_eq!(pack_config.weights[0] == (1, 100, 5), true); - assert_eq!( - pack_config.action_to_do == CleanUpActions::Change(1, 4), - true - ); + assert_eq!(pack_config.weights[0], (1, 100, 5)); + assert_eq!(pack_config.action_to_do, CleanUpActions::Change(1, 4)); test_pack_set.clean_up(&mut context).await.unwrap(); let pack_config_account = get_account(&mut context, &pack_config_key).await; let pack_config = PackConfig::unpack_from_slice(&pack_config_account.data).unwrap(); - assert_eq!(pack_config.weights[0] == (1, 100, 4), true); - assert_eq!(pack_config.action_to_do == CleanUpActions::None, true); + assert_eq!(pack_config.weights[0], (1, 100, 4)); + assert_eq!(pack_config.action_to_do, CleanUpActions::None); } #[tokio::test] @@ -315,14 +313,14 @@ async fn success_clean_up_sort() { let pack_config_account = get_account(&mut context, &pack_config_key).await; let pack_config = PackConfig::unpack_from_slice(&pack_config_account.data).unwrap(); - assert_eq!(pack_config.action_to_do == CleanUpActions::Sort, true); - assert_eq!(pack_config.weights[0] == (1, 40, 5), true); + assert_eq!(pack_config.action_to_do, CleanUpActions::Sort); + assert_eq!(pack_config.weights[0], (1, 40, 5)); test_pack_set.clean_up(&mut context).await.unwrap(); let pack_config_account = get_account(&mut context, &pack_config_key).await; let pack_config = PackConfig::unpack_from_slice(&pack_config_account.data).unwrap(); - assert!(pack_config.action_to_do == CleanUpActions::None, "{}", true); - assert_eq!(pack_config.weights[0] == (2, 60, 5), true); + assert_eq!(pack_config.action_to_do, CleanUpActions::None, "{}", true); + assert_eq!(pack_config.weights[0], (2, 60, 5)); } diff --git a/nft-packs/program/tests/close_pack.rs b/nft-packs/program/tests/close_pack.rs index 93d7d9546a..8396b4354f 100644 --- a/nft-packs/program/tests/close_pack.rs +++ b/nft-packs/program/tests/close_pack.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ diff --git a/nft-packs/program/tests/deactivate.rs b/nft-packs/program/tests/deactivate.rs index 7ba98572b9..d5e17fed2b 100644 --- a/nft-packs/program/tests/deactivate.rs +++ b/nft-packs/program/tests/deactivate.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ diff --git a/nft-packs/program/tests/delete_pack.rs b/nft-packs/program/tests/delete_pack.rs index e95afc8493..f5c6397f4e 100644 --- a/nft-packs/program/tests/delete_pack.rs +++ b/nft-packs/program/tests/delete_pack.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ diff --git a/nft-packs/program/tests/delete_pack_card.rs b/nft-packs/program/tests/delete_pack_card.rs index 627c6c545b..11114929de 100644 --- a/nft-packs/program/tests/delete_pack_card.rs +++ b/nft-packs/program/tests/delete_pack_card.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ diff --git a/nft-packs/program/tests/delete_pack_voucher.rs b/nft-packs/program/tests/delete_pack_voucher.rs index 3fd8a22936..01ce463850 100644 --- a/nft-packs/program/tests/delete_pack_voucher.rs +++ b/nft-packs/program/tests/delete_pack_voucher.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ @@ -235,7 +236,8 @@ async fn fail_invalid_state() { let result = test_pack_set .delete_voucher(&mut context, &test_pack_voucher, &payer_pubkey) - .await.unwrap_err(); + .await + .unwrap_err(); assert_custom_error!(result, NFTPacksError::WrongPackState, 0); } diff --git a/nft-packs/program/tests/edit_pack.rs b/nft-packs/program/tests/edit_pack.rs index 7cd194fcbb..bd418cd04d 100644 --- a/nft-packs/program/tests/edit_pack.rs +++ b/nft-packs/program/tests/edit_pack.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ diff --git a/nft-packs/program/tests/init_pack_set.rs b/nft-packs/program/tests/init_pack_set.rs index 04184a5481..1a524bb232 100644 --- a/nft-packs/program/tests/init_pack_set.rs +++ b/nft-packs/program/tests/init_pack_set.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ diff --git a/nft-packs/program/tests/request_card_to_redeem.rs b/nft-packs/program/tests/request_card_to_redeem.rs index 01b9c7c32b..efb6e9fb90 100644 --- a/nft-packs/program/tests/request_card_to_redeem.rs +++ b/nft-packs/program/tests/request_card_to_redeem.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ @@ -608,7 +609,7 @@ async fn fail_request_after_end_date() { .await .unwrap() .unix_timestamp as u64; - assert_eq!(last_timestamp > redeem_end_date.unwrap(), true); + assert!(last_timestamp > redeem_end_date.unwrap()); let err = test_pack_set .request_card_for_redeem( @@ -756,7 +757,7 @@ async fn fail_request_with_invalid_voucher() { .await .unwrap() .unix_timestamp as u64; - assert_eq!(last_timestamp > redeem_end_date.unwrap(), true); + assert!(last_timestamp > redeem_end_date.unwrap()); let err = test_pack_set .request_card_for_redeem_fake_voucher( diff --git a/nft-packs/program/tests/transfer_pack_authority.rs b/nft-packs/program/tests/transfer_pack_authority.rs index fe93d6f5bf..0fe6525bf0 100644 --- a/nft-packs/program/tests/transfer_pack_authority.rs +++ b/nft-packs/program/tests/transfer_pack_authority.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "test-bpf")] mod utils; use mpl_nft_packs::{ @@ -222,7 +223,8 @@ async fn fail_invalid_state() { let result = test_pack_set .transfer_pack_authority(&mut context, &new_minting_authority.pubkey()) - .await.unwrap_err(); + .await + .unwrap_err(); assert_custom_error!(result, NFTPacksError::WrongPackState, 0); } diff --git a/nft-packs/program/tests/utils/mod.rs b/nft-packs/program/tests/utils/mod.rs index d276328d55..5262e433ab 100644 --- a/nft-packs/program/tests/utils/mod.rs +++ b/nft-packs/program/tests/utils/mod.rs @@ -11,8 +11,6 @@ mod pack_voucher; mod user; mod vault; -pub use assert::*; -pub use edition::*; pub use edition_marker::TestEditionMarker; pub use external_price::TestExternalPrice; pub use master_edition_v2::TestMasterEditionV2; @@ -37,7 +35,7 @@ use std::{env, time}; pub use user::*; pub use vault::TestVault; -pub fn nft_packs_program_test<'a>() -> ProgramTest { +pub fn nft_packs_program_test() -> ProgramTest { let mut program = ProgramTest::new("mpl_nft_packs", mpl_nft_packs::id(), None); program.add_program("mpl_token_metadata", mpl_token_metadata::id(), None); program.add_program("mpl_metaplex", mpl_metaplex::id(), None); diff --git a/token-entangler/program/Cargo.toml b/token-entangler/program/Cargo.toml index 0347417371..b93c188252 100644 --- a/token-entangler/program/Cargo.toml +++ b/token-entangler/program/Cargo.toml @@ -13,6 +13,7 @@ name = "mpl_token_entangler" [features] no-entrypoint = [] no-idl = [] +test-bpf = [] cpi = ["no-entrypoint"] default = [] diff --git a/token-entangler/program/tests/entangler_lifecycle_test.rs b/token-entangler/program/tests/entangler_lifecycle_test.rs index c97cb95483..675a93a476 100644 --- a/token-entangler/program/tests/entangler_lifecycle_test.rs +++ b/token-entangler/program/tests/entangler_lifecycle_test.rs @@ -1,9 +1,10 @@ +#![cfg(feature = "test-bpf")] use anchor_lang::{ prelude::{Pubkey, Rent}, InstructionData, ToAccountMetas, }; use mpl_token_metadata::{instruction::create_metadata_accounts, pda::find_metadata_account}; -use solana_program_test::ProgramTest; +use solana_program_test::{tokio, ProgramTest}; use solana_sdk::{ instruction::Instruction, program_pack::Pack, signature::Keypair, signer::Signer, system_instruction::create_account, transaction::Transaction, @@ -18,7 +19,7 @@ use test_utils::{ instructions_to_mint_an_nft, }; -// #[tokio::test] +#[tokio::test] async fn _lifecycle_test() { const TREASURY_MINT: &str = "So11111111111111111111111111111111111111112"; const RENT_SYSVAR_ADDRESS: &str = "SysvarRent111111111111111111111111111111111";