From 70a0cf241ebb29ee5bd4c8cf4c426b72e7e4a7d7 Mon Sep 17 00:00:00 2001 From: blockiosaurus <90809591+blockiosaurus@users.noreply.github.com> Date: Fri, 1 Nov 2024 06:21:57 -0400 Subject: [PATCH] Fixing some IX perms (#150) * Fixing inconsistencies with permissions related to performing certain IXes on TM accounts. * Adding back ignores and fixing tests. --- configs/program-scripts/test.sh | 6 +- .../program/src/processor/resize/mod.rs | 6 +- .../token-metadata/program/tests/resize.rs | 364 +++--------------- .../program/tests/utils/metadata.rs | 48 --- 4 files changed, 59 insertions(+), 365 deletions(-) diff --git a/configs/program-scripts/test.sh b/configs/program-scripts/test.sh index 04155d17..4bc6ab7d 100755 --- a/configs/program-scripts/test.sh +++ b/configs/program-scripts/test.sh @@ -39,8 +39,8 @@ for p in ${PROGRAMS[@]}; do CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded -- --nocapture 2>&1 | ${SOLFMT} && \ CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded resize -- --nocapture 2>&1 | ${SOLFMT} else - cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} -- --nocapture && \ - cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded -- --nocapture && \ - cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded resize -- --nocapture + cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} -- --nocapture --test-threads=1 && \ + cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded -- --nocapture --test-threads=1 && \ + cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded resize -- --nocapture --test-threads=1 fi done diff --git a/programs/token-metadata/program/src/processor/resize/mod.rs b/programs/token-metadata/program/src/processor/resize/mod.rs index e5326d2d..ba45f645 100644 --- a/programs/token-metadata/program/src/processor/resize/mod.rs +++ b/programs/token-metadata/program/src/processor/resize/mod.rs @@ -122,10 +122,8 @@ pub fn process_resize<'a>( } // No need to check edition ownership since it is empty for fungibles. - // For fungibles, the update authority is the one who can resize the asset, - // so we need to check that the authority is the update authority of the metadata account. - // Or if the claim period is over, the authority is the resize authority. - if metadata.update_authority != *authority.key && authority.key != &RESIZE_AUTHORITY { + // For fungibles only the resize authority can resize the asset. + if authority.key != &RESIZE_AUTHORITY { return Err(MetadataError::UpdateAuthorityIncorrect.into()); } } diff --git a/programs/token-metadata/program/tests/resize.rs b/programs/token-metadata/program/tests/resize.rs index 430cd60f..55f8723d 100644 --- a/programs/token-metadata/program/tests/resize.rs +++ b/programs/token-metadata/program/tests/resize.rs @@ -31,8 +31,6 @@ mod resize { [spl_token::id(), spl_token_2022::id()], [ TokenStandard::NonFungible, - TokenStandard::FungibleAsset, - TokenStandard::Fungible, TokenStandard::ProgrammableNonFungible, ] )] @@ -53,23 +51,10 @@ mod resize { .await .unwrap(); - let edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, nft.edition.unwrap()).await; - nft.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&nft.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; - let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(nft.metadata) - .edition(edition) + .edition(nft.edition.unwrap()) .mint(nft.mint.pubkey()) .payer(context.payer.pubkey()) .token(nft.token.unwrap()) @@ -87,7 +72,11 @@ mod resize { .get_balance(nft.metadata) .await .unwrap(); - let edition_rent_before = context.banks_client.get_balance(edition).await.unwrap(); + let edition_rent_before = context + .banks_client + .get_balance(nft.edition.unwrap()) + .await + .unwrap(); let destination_rent_before = context .banks_client .get_balance(context.payer.pubkey()) @@ -96,21 +85,17 @@ mod resize { assert_before_metadata(&mut context, nft.metadata).await; context.banks_client.process_transaction(tx).await.unwrap(); assert_after_metadata(&mut context, nft.metadata).await; - match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_after_master_edition(&mut context, nft.edition.unwrap()).await; - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => {} - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_after_master_edition(&mut context, nft.edition.unwrap()).await; let metadata_rent_after = context .banks_client .get_balance(nft.metadata) .await .unwrap(); - let edition_rent_after = context.banks_client.get_balance(edition).await.unwrap(); + let edition_rent_after = context + .banks_client + .get_balance(nft.edition.unwrap()) + .await + .unwrap(); let destination_rent_after = context .banks_client .get_balance(context.payer.pubkey()) @@ -174,24 +159,13 @@ mod resize { .await .unwrap(); - let edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, nft.edition.unwrap()).await; - nft.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&nft.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_before_master_edition(&mut context, nft.edition.unwrap()).await; context.warp_to_slot(200).unwrap(); let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(nft.metadata) - .edition(edition) + .edition(nft.edition.unwrap()) .mint(nft.mint.pubkey()) .payer(destination.pubkey()) .authority(context.payer.pubkey()) @@ -210,7 +184,11 @@ mod resize { .get_balance(nft.metadata) .await .unwrap(); - let edition_rent_before = context.banks_client.get_balance(edition).await.unwrap(); + let edition_rent_before = context + .banks_client + .get_balance(nft.edition.unwrap()) + .await + .unwrap(); let destination_rent_before = context .banks_client .get_balance(destination.pubkey()) @@ -219,151 +197,17 @@ mod resize { assert_before_metadata(&mut context, nft.metadata).await; context.banks_client.process_transaction(tx).await.unwrap(); assert_after_metadata(&mut context, nft.metadata).await; - match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_after_master_edition(&mut context, nft.edition.unwrap()).await; - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => {} - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_after_master_edition(&mut context, nft.edition.unwrap()).await; let metadata_rent_after = context .banks_client .get_balance(nft.metadata) .await .unwrap(); - let edition_rent_after = context.banks_client.get_balance(edition).await.unwrap(); - let destination_rent_after = context + let edition_rent_after = context .banks_client - .get_balance(destination.pubkey()) - .await - .unwrap(); - - let metadata_rent_diff = metadata_rent_before - metadata_rent_after; - let edition_rent_diff = edition_rent_before - edition_rent_after; - let destination_rent_diff = destination_rent_after - destination_rent_before; - assert_eq!( - metadata_rent_diff + edition_rent_diff, // 5000 for transaction fee - destination_rent_diff - ); - } - - #[test_case::test_matrix( - [spl_token::id(), spl_token_2022::id()], - [ - TokenStandard::Fungible, - TokenStandard::FungibleAsset, - ] - )] - #[tokio::test] - // Currently ignoring due to DeadlineExceeded errors. - #[ignore] - async fn resize_fungible_as_update_authority( - spl_token_program: Pubkey, - token_standard: TokenStandard, - ) { - // Create NFTs and then collect the fees from the metadata accounts. - let mut context = program_test().start_with_context().await; - let update_authority = Keypair::new(); - let destination = Keypair::new(); - let mut fungible = DigitalAsset::new(); - fungible - .create_and_mint( - &mut context, - token_standard, - None, - None, - 1, - spl_token_program, - ) - .await - .unwrap(); - - let context_payer = Keypair::from_bytes(&context.payer.to_bytes()).unwrap(); - - context.warp_to_slot(100).unwrap(); - - fungible - .update( - &mut context, - context_payer, - UpdateArgs::V1 { - new_update_authority: Some(update_authority.pubkey()), - data: None, - primary_sale_happened: None, - is_mutable: None, - collection: CollectionToggle::None, - collection_details: CollectionDetailsToggle::None, - uses: UsesToggle::None, - rule_set: RuleSetToggle::None, - authorization_data: None, - }, - ) + .get_balance(nft.edition.unwrap()) .await .unwrap(); - - let edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, fungible.edition.unwrap()).await; - fungible.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&fungible.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; - - context.warp_to_slot(200).unwrap(); - let tx = Transaction::new_signed_with_payer( - &[ResizeBuilder::new() - .metadata(fungible.metadata) - .edition(edition) - .mint(fungible.mint.pubkey()) - .payer(destination.pubkey()) - .authority(update_authority.pubkey()) - .token(fungible.token.unwrap()) - .system_program(solana_program::system_program::ID) - .build() - .unwrap() - .instruction()], - Some(&update_authority.pubkey()), - &[&update_authority], - context.get_new_latest_blockhash().await.unwrap(), - ); - - let metadata_rent_before = context - .banks_client - .get_balance(fungible.metadata) - .await - .unwrap(); - let edition_rent_before = context.banks_client.get_balance(edition).await.unwrap(); - let destination_rent_before = context - .banks_client - .get_balance(destination.pubkey()) - .await - .unwrap(); - assert_before_metadata(&mut context, fungible.metadata).await; - context.warp_to_slot(300).unwrap(); - context.banks_client.process_transaction(tx).await.unwrap(); - assert_after_metadata(&mut context, fungible.metadata).await; - match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_after_master_edition(&mut context, fungible.edition.unwrap()).await; - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => {} - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; - let metadata_rent_after = context - .banks_client - .get_balance(fungible.metadata) - .await - .unwrap(); - let edition_rent_after = context.banks_client.get_balance(edition).await.unwrap(); let destination_rent_after = context .banks_client .get_balance(destination.pubkey()) @@ -383,8 +227,6 @@ mod resize { [spl_token::id(), spl_token_2022::id()], [ TokenStandard::NonFungible, - TokenStandard::FungibleAsset, - TokenStandard::Fungible, TokenStandard::ProgrammableNonFungible, ] )] @@ -412,23 +254,12 @@ mod resize { .await .unwrap(); - let edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, nft.edition.unwrap()).await; - nft.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&nft.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_before_master_edition(&mut context, nft.edition.unwrap()).await; let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(nft.metadata) - .edition(edition) + .edition(nft.edition.unwrap()) .mint(nft.mint.pubkey()) .payer(payer.pubkey()) .authority(context.payer.pubkey()) @@ -447,7 +278,11 @@ mod resize { .get_balance(nft.metadata) .await .unwrap(); - let edition_rent_before = context.banks_client.get_balance(edition).await.unwrap(); + let edition_rent_before = context + .banks_client + .get_balance(nft.edition.unwrap()) + .await + .unwrap(); let destination_rent_before = context .banks_client .get_balance(payer.pubkey()) @@ -456,21 +291,17 @@ mod resize { assert_before_metadata(&mut context, nft.metadata).await; context.banks_client.process_transaction(tx).await.unwrap(); assert_after_metadata(&mut context, nft.metadata).await; - match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_after_master_edition(&mut context, nft.edition.unwrap()).await; - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => {} - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_after_master_edition(&mut context, nft.edition.unwrap()).await; let metadata_rent_after = context .banks_client .get_balance(nft.metadata) .await .unwrap(); - let edition_rent_after = context.banks_client.get_balance(edition).await.unwrap(); + let edition_rent_after = context + .banks_client + .get_balance(nft.edition.unwrap()) + .await + .unwrap(); let destination_rent_after = context .banks_client .get_balance(payer.pubkey()) @@ -685,8 +516,6 @@ mod resize { [spl_token::id(), spl_token_2022::id()], [ TokenStandard::NonFungible, - TokenStandard::FungibleAsset, - TokenStandard::Fungible, TokenStandard::ProgrammableNonFungible, ] )] @@ -722,23 +551,12 @@ mod resize { .await .unwrap(); - let edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, nft.edition.unwrap()).await; - nft.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&nft.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_before_master_edition(&mut context, nft.edition.unwrap()).await; let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(other_nft.metadata) - .edition(edition) + .edition(nft.edition.unwrap()) .mint(nft.mint.pubkey()) .payer(context.payer.pubkey()) .token(nft.token.unwrap()) @@ -765,8 +583,6 @@ mod resize { [spl_token::id(), spl_token_2022::id()], [ TokenStandard::NonFungible, - TokenStandard::FungibleAsset, - TokenStandard::Fungible, TokenStandard::ProgrammableNonFungible, ] )] @@ -799,23 +615,12 @@ mod resize { .await .unwrap(); - let other_edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, other_nft.edition.unwrap()).await; - other_nft.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&other_nft.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_before_master_edition(&mut context, other_nft.edition.unwrap()).await; let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(nft.metadata) - .edition(other_edition) + .edition(other_nft.edition.unwrap()) .mint(nft.mint.pubkey()) .payer(context.payer.pubkey()) .token(nft.token.unwrap()) @@ -842,8 +647,6 @@ mod resize { [spl_token::id(), spl_token_2022::id()], [ TokenStandard::NonFungible, - TokenStandard::FungibleAsset, - TokenStandard::Fungible, TokenStandard::ProgrammableNonFungible, ] )] @@ -876,23 +679,12 @@ mod resize { .await .unwrap(); - let edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, nft.edition.unwrap()).await; - nft.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&nft.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_before_master_edition(&mut context, nft.edition.unwrap()).await; let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(nft.metadata) - .edition(edition) + .edition(nft.edition.unwrap()) .mint(other_nft.mint.pubkey()) .payer(context.payer.pubkey()) .token(nft.token.unwrap()) @@ -919,8 +711,6 @@ mod resize { [spl_token::id(), spl_token_2022::id()], [ TokenStandard::NonFungible, - TokenStandard::FungibleAsset, - TokenStandard::Fungible, TokenStandard::ProgrammableNonFungible, ] )] @@ -956,23 +746,12 @@ mod resize { .await .unwrap(); - let other_edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, other_nft.edition.unwrap()).await; - other_nft.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&other_nft.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_before_master_edition(&mut context, other_nft.edition.unwrap()).await; let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(nft.metadata) - .edition(other_edition) + .edition(other_nft.edition.unwrap()) .mint(other_nft.mint.pubkey()) .payer(context.payer.pubkey()) .token(nft.token.unwrap()) @@ -1032,23 +811,12 @@ mod resize { .await .unwrap(); - let edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, nft.edition.unwrap()).await; - nft.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&nft.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_before_master_edition(&mut context, nft.edition.unwrap()).await; let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(nft.metadata) - .edition(edition) + .edition(nft.edition.unwrap()) .mint(nft.mint.pubkey()) .payer(context.payer.pubkey()) .token(other_nft.token.unwrap()) @@ -1119,23 +887,12 @@ mod resize { .await .unwrap(); - let edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, nft.edition.unwrap()).await; - nft.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&nft.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; + assert_before_master_edition(&mut context, nft.edition.unwrap()).await; let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(nft.metadata) - .edition(edition) + .edition(nft.edition.unwrap()) .mint(nft.mint.pubkey()) .payer(context.payer.pubkey()) .authority(update_authority.pubkey()) @@ -1167,14 +924,12 @@ mod resize { ] )] #[tokio::test] - async fn cannot_resize_fungible_as_token_holder( + async fn cannot_resize_fungible_as_update_authority( spl_token_program: Pubkey, token_standard: TokenStandard, ) { // Create NFTs and then collect the fees from the metadata accounts. let mut context = program_test().start_with_context().await; - let update_authority = Keypair::new(); - let destination = Keypair::new(); let mut fungible = DigitalAsset::new(); fungible .create_and_mint( @@ -1189,6 +944,7 @@ mod resize { .unwrap(); let context_payer = Keypair::from_bytes(&context.payer.to_bytes()).unwrap(); + let update_authority = Keypair::new(); context.warp_to_slot(10).unwrap(); fungible @@ -1210,36 +966,24 @@ mod resize { .await .unwrap(); - let edition = match token_standard { - TokenStandard::NonFungible | TokenStandard::ProgrammableNonFungible => { - assert_before_master_edition(&mut context, fungible.edition.unwrap()).await; - fungible.edition.unwrap() - } - TokenStandard::FungibleAsset | TokenStandard::Fungible => { - find_master_edition_account(&fungible.mint.pubkey()).0 - } - TokenStandard::NonFungibleEdition | TokenStandard::ProgrammableNonFungibleEdition => { - panic!("Invalid test for Editions") - } - }; - let tx = Transaction::new_signed_with_payer( &[ResizeBuilder::new() .metadata(fungible.metadata) - .edition(edition) + .edition(find_master_edition_account(&fungible.mint.pubkey()).0) .mint(fungible.mint.pubkey()) - .payer(destination.pubkey()) - .authority(context.payer.pubkey()) + .payer(context.payer.pubkey()) + .authority(update_authority.pubkey()) .token(fungible.token.unwrap()) .system_program(solana_program::system_program::ID) .build() .unwrap() .instruction()], Some(&context.payer.pubkey()), - &[&context.payer], + &[&context.payer, &update_authority], context.last_blockhash, ); + assert_before_metadata(&mut context, fungible.metadata).await; let result = context .banks_client .process_transaction(tx) diff --git a/programs/token-metadata/program/tests/utils/metadata.rs b/programs/token-metadata/program/tests/utils/metadata.rs index e6b12369..d7c34c22 100644 --- a/programs/token-metadata/program/tests/utils/metadata.rs +++ b/programs/token-metadata/program/tests/utils/metadata.rs @@ -240,30 +240,6 @@ impl Metadata { #[cfg(feature = "padded")] upsize_metadata(context, &self.pubkey).await; - #[cfg(feature = "resize")] - { - let tx = Transaction::new_signed_with_payer( - &[ResizeBuilder::new() - .metadata(self.pubkey) - .edition(find_master_edition_account(&self.mint.pubkey()).0) - .mint(self.mint.pubkey()) - .payer(context.payer.pubkey()) - .authority(context.payer.pubkey()) - .token(self.token.pubkey()) - .system_program(solana_program::system_program::ID) - .build() - .unwrap() - .instruction()], - Some(&context.payer.pubkey()), - &[&context.payer], - context.last_blockhash, - ); - - assert_before_metadata(context, self.pubkey).await; - context.banks_client.process_transaction(tx).await?; - assert_after_metadata(context, self.pubkey).await; - } - Ok(()) } @@ -340,30 +316,6 @@ impl Metadata { #[cfg(feature = "padded")] upsize_metadata(context, &self.pubkey).await; - #[cfg(feature = "resize")] - { - let tx = Transaction::new_signed_with_payer( - &[ResizeBuilder::new() - .metadata(self.pubkey) - .edition(find_master_edition_account(&self.mint.pubkey()).0) - .mint(self.mint.pubkey()) - .payer(context.payer.pubkey()) - .authority(context.payer.pubkey()) - .token(self.token.pubkey()) - .system_program(solana_program::system_program::ID) - .build() - .unwrap() - .instruction()], - Some(&context.payer.pubkey()), - &[&context.payer], - context.last_blockhash, - ); - - assert_before_metadata(context, self.pubkey).await; - context.banks_client.process_transaction(tx).await?; - assert_after_metadata(context, self.pubkey).await; - } - Ok(()) }