From ab5eea50236a18df758528953313aacca35fd30d Mon Sep 17 00:00:00 2001 From: blockiosaurus Date: Mon, 8 Apr 2024 20:45:07 -0400 Subject: [PATCH] Finishing PR with published mpl-utils. --- programs/token-metadata/Cargo.lock | 21 ++++++------------- programs/token-metadata/program/Cargo.toml | 4 +--- .../src/processor/metadata/transfer.rs | 7 +++++-- .../program/src/utils/programmable_asset.rs | 2 +- 4 files changed, 13 insertions(+), 21 deletions(-) diff --git a/programs/token-metadata/Cargo.lock b/programs/token-metadata/Cargo.lock index 3bfd48e7..0842b8bc 100644 --- a/programs/token-metadata/Cargo.lock +++ b/programs/token-metadata/Cargo.lock @@ -2143,7 +2143,7 @@ dependencies = [ "borsh 0.9.3", "mpl-token-auth-rules", "mpl-token-metadata-context-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "mpl-utils 0.3.2", + "mpl-utils", "num-derive 0.3.3", "num-traits", "shank 0.0.11", @@ -2183,24 +2183,15 @@ dependencies = [ [[package]] name = "mpl-utils" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfbd03696c53e72ae822e9ee8cae3e156031e30e9b4d5b3b33ae3990e79116f3" +checksum = "a82f6f747cb3014adcd33689fbcf09a38564b78915d8893553e7c6eccfaf4aa8" dependencies = [ "arrayref", "solana-program", "spl-token-2022 0.8.0", ] -[[package]] -name = "mpl-utils" -version = "0.3.3" -dependencies = [ - "arrayref", - "solana-program", - "spl-token-2022 0.6.1", -] - [[package]] name = "nix" version = "0.26.4" @@ -3022,7 +3013,7 @@ source = "git+https://github.com/metaplex-foundation/rooster#e424745fd5abfe1442f dependencies = [ "borsh 0.9.3", "mpl-token-metadata", - "mpl-utils 0.3.2", + "mpl-utils", "num-derive 0.3.3", "num-traits", "shank 0.0.10", @@ -5183,7 +5174,7 @@ dependencies = [ "borsh 0.9.3", "mpl-token-auth-rules", "mpl-token-metadata-context-derive 0.3.0", - "mpl-utils 0.3.3", + "mpl-utils", "num-derive 0.3.3", "num-traits", "rmp-serde", @@ -5194,7 +5185,7 @@ dependencies = [ "solana-program", "solana-program-test", "solana-sdk", - "spl-associated-token-account 1.1.3", + "spl-associated-token-account 2.1.0", "spl-token 3.5.0", "spl-token-2022 0.8.0", "test-case", diff --git a/programs/token-metadata/program/Cargo.toml b/programs/token-metadata/program/Cargo.toml index d852e8df..555c68e2 100644 --- a/programs/token-metadata/program/Cargo.toml +++ b/programs/token-metadata/program/Cargo.toml @@ -20,9 +20,7 @@ mpl-token-auth-rules = { version = "=1.4.3-beta.1", features = [ "no-entrypoint", ] } mpl-token-metadata-context-derive = { version = "0.3.0", path = "../macro" } -mpl-utils = { path = "/home/kelliott/work/mpl/metaplex-program-library/core/rust/utils", features = [ - "spl-token", -] } +mpl-utils = { version = "0.3.4", features = ["spl-token"] } num-derive = "0.3" num-traits = "0.2" serde = { version = "1.0.149", optional = true } diff --git a/programs/token-metadata/program/src/processor/metadata/transfer.rs b/programs/token-metadata/program/src/processor/metadata/transfer.rs index 00d19d68..d4700fe5 100644 --- a/programs/token-metadata/program/src/processor/metadata/transfer.rs +++ b/programs/token-metadata/program/src/processor/metadata/transfer.rs @@ -217,7 +217,6 @@ fn transfer_v1(program_id: &Pubkey, ctx: Context, args: TransferArgs) authority_signer_seeds: None, token_program: ctx.accounts.spl_token_program_info.clone(), decimals: mint.decimals, - edition_bump: metadata.edition_nonce, }; let token_standard = metadata.token_standard; @@ -399,7 +398,11 @@ fn transfer_v1(program_id: &Pubkey, ctx: Context, args: TransferArgs) }; auth_rules_validate(auth_rules_validate_params)?; - frozen_transfer(token_transfer_params, ctx.accounts.edition_info)?; + frozen_transfer( + token_transfer_params, + metadata.edition_nonce, + ctx.accounts.edition_info, + )?; let master_edition_info = ctx .accounts diff --git a/programs/token-metadata/program/src/utils/programmable_asset.rs b/programs/token-metadata/program/src/utils/programmable_asset.rs index 9f58821c..35345a70 100644 --- a/programs/token-metadata/program/src/utils/programmable_asset.rs +++ b/programs/token-metadata/program/src/utils/programmable_asset.rs @@ -333,9 +333,9 @@ pub fn auth_rules_validate(params: AuthRulesValidateParams) -> ProgramResult { pub fn frozen_transfer<'a>( params: TokenTransferCheckedParams<'a, '_>, + edition_bump: Option, edition_opt_info: Option<&'a AccountInfo<'a>>, ) -> ProgramResult { - let edition_bump = params.edition_bump; if edition_opt_info.is_none() { return Err(MetadataError::MissingEditionAccount.into()); }