Bladeren bron

spl: remove mpl `create_metadata_account_v2` wrapper that were removed from program (#2480)

* remove mpl ix wrappers that were removed from program

* update changelog
Matthew Callens 2 jaren geleden
bovenliggende
commit
ac86e15756
4 gewijzigde bestanden met toevoegingen van 8 en 60 verwijderingen
  1. 1 0
      CHANGELOG.md
  2. 4 4
      Cargo.lock
  3. 1 1
      spl/Cargo.toml
  4. 2 55
      spl/src/metadata.rs

+ 1 - 0
CHANGELOG.md

@@ -25,6 +25,7 @@ The minor version will be incremented upon a breaking change and the patch versi
 ### Breaking
 
 - lang: Identifiers that are intended for internal usage(`program_id`, `accounts`, `ix_data`, `remaining_accounts`) have been renamed with `__` prefix ([#2464](https://github.com/coral-xyz/anchor/pull/2464))
+- spl: Remove the `metadata::create_metadata_account_v2` deprecated wrapper since it was removed from token metadata program ([#2480](https://github.com/coral-xyz/anchor/pull/2480))
 
 ## [0.27.0] - 2023-03-08
 

+ 4 - 4
Cargo.lock

@@ -2380,9 +2380,9 @@ dependencies = [
 
 [[package]]
 name = "mpl-token-metadata"
-version = "1.9.0"
+version = "1.11.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8831a402e72f24052d019a83d72b70c38673caaf198e6e345575a77f98166b1"
+checksum = "aed414104154928aa995a44a0a474c449d04ce5a4ee6c975ad41c5d2912f0dfe"
 dependencies = [
  "arrayref",
  "borsh",
@@ -2410,9 +2410,9 @@ dependencies = [
 
 [[package]]
 name = "mpl-utils"
-version = "0.1.0"
+version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fc48e64c50dba956acb46eec86d6968ef0401ef37031426da479f1f2b592066"
+checksum = "822133b6cba8f9a43e5e0e189813be63dd795858f54155c729833be472ffdb51"
 dependencies = [
  "arrayref",
  "borsh",

+ 1 - 1
spl/Cargo.toml

@@ -28,7 +28,7 @@ solana-program = "1.14.16"
 spl-token = { version = "3.5.0", features = ["no-entrypoint"], optional = true }
 spl-token-2022 = { version = "0.5.0", features = ["no-entrypoint"], optional = true }
 spl-associated-token-account = { version = "1.1.1", features = ["no-entrypoint"], optional = true }
-mpl-token-metadata = { version = "^1.9.0", optional = true, features = ["no-entrypoint"] }
+mpl-token-metadata = { version = "^1.11.0", optional = true, features = ["no-entrypoint"] }
 
 # TODO: Remove after updating to latest version of platform-tools.
 # Latest solana version(1.14.17) as of 2023-05-01 comes with rustc 1.62.0-dev but MSRV for latest

+ 2 - 55
spl/src/metadata.rs

@@ -1,5 +1,6 @@
 use anchor_lang::context::CpiContext;
-use anchor_lang::{Accounts, ErrorCode, Result, ToAccountInfos};
+use anchor_lang::error::ErrorCode;
+use anchor_lang::{Accounts, Result, ToAccountInfos};
 use mpl_token_metadata::state::{CollectionDetails, DataV2, TokenMetadataAccount};
 use mpl_token_metadata::ID;
 use solana_program::account_info::AccountInfo;
@@ -50,7 +51,6 @@ pub fn bubblegum_set_collection_size<'info>(
 
 pub fn burn_edition_nft<'info>(
     ctx: CpiContext<'_, '_, '_, 'info, BurnEditionNft<'info>>,
-    collection_metadata: Option<Pubkey>,
 ) -> Result<()> {
     let ix = mpl_token_metadata::instruction::burn_edition_nft(
         ID,
@@ -95,47 +95,6 @@ pub fn burn_nft<'info>(
     .map_err(Into::into)
 }
 
-#[deprecated(note = "internal instructions deprecated by Metaplex")]
-pub fn create_metadata_accounts_v2<'info>(
-    ctx: CpiContext<'_, '_, '_, 'info, CreateMetadataAccountsV2<'info>>,
-    data: DataV2,
-    is_mutable: bool,
-    update_authority_is_signer: bool,
-) -> Result<()> {
-    let DataV2 {
-        name,
-        symbol,
-        uri,
-        creators,
-        seller_fee_basis_points,
-        collection,
-        uses,
-    } = data;
-    let ix = mpl_token_metadata::instruction::create_metadata_accounts_v2(
-        ID,
-        *ctx.accounts.metadata.key,
-        *ctx.accounts.mint.key,
-        *ctx.accounts.mint_authority.key,
-        *ctx.accounts.payer.key,
-        *ctx.accounts.update_authority.key,
-        name,
-        symbol,
-        uri,
-        creators,
-        seller_fee_basis_points,
-        update_authority_is_signer,
-        is_mutable,
-        collection,
-        uses,
-    );
-    solana_program::program::invoke_signed(
-        &ix,
-        &ToAccountInfos::to_account_infos(&ctx),
-        ctx.signer_seeds,
-    )
-    .map_err(Into::into)
-}
-
 pub fn create_metadata_accounts_v3<'info>(
     ctx: CpiContext<'_, '_, '_, 'info, CreateMetadataAccountsV3<'info>>,
     data: DataV2,
@@ -595,18 +554,6 @@ pub struct BurnNft<'info> {
     pub spl_token: AccountInfo<'info>,
 }
 
-#[deprecated(note = "internal instructions deprecated by Metaplex")]
-#[derive(Accounts)]
-pub struct CreateMetadataAccountsV2<'info> {
-    pub metadata: AccountInfo<'info>,
-    pub mint: AccountInfo<'info>,
-    pub mint_authority: AccountInfo<'info>,
-    pub payer: AccountInfo<'info>,
-    pub update_authority: AccountInfo<'info>,
-    pub system_program: AccountInfo<'info>,
-    pub rent: AccountInfo<'info>,
-}
-
 #[derive(Accounts)]
 pub struct CreateMetadataAccountsV3<'info> {
     pub metadata: AccountInfo<'info>,