Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename metadata interface ix fields from token_program_id to program_id #3076

Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ The minor version will be incremented upon a breaking change and the patch versi
- lang: Require `Discriminator` trait impl when using the `zero` constraint ([#3118](https://github.com/coral-xyz/anchor/pull/3118)).
- ts: Remove `DISCRIMINATOR_SIZE` constant ([#3120](https://github.com/coral-xyz/anchor/pull/3120)).
- lang: `#[account]` attribute arguments no longer parses identifiers as namespaces ([#3140](https://github.com/coral-xyz/anchor/pull/3140)).
- spl: Rename metadata interface instruction fields from `token_program_id` to `program_id` ([3076](https://github.com/coral-xyz/anchor/pull/3076)).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing "#":

Suggested change
- spl: Rename metadata interface instruction fields from `token_program_id` to `program_id` ([3076](https://github.com/coral-xyz/anchor/pull/3076)).
- spl: Rename metadata interface instruction fields from `token_program_id` to `program_id` ([#3076](https://github.com/coral-xyz/anchor/pull/3076)).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind — I was going to commit this before merging, but couldn't due to this branch belonging to an organization's fork


## [0.30.1] - 2024-06-20

Expand Down
12 changes: 6 additions & 6 deletions spl/src/token_2022_extensions/token_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn token_group_initialize<'info>(
max_size: u32,
) -> Result<()> {
let ix = spl_token_group_interface::instruction::initialize_group(
ctx.accounts.token_program_id.key,
ctx.accounts.program_id.key,
ctx.accounts.group.key,
ctx.accounts.mint.key,
ctx.accounts.mint_authority.key,
Expand All @@ -19,7 +19,7 @@ pub fn token_group_initialize<'info>(
anchor_lang::solana_program::program::invoke_signed(
&ix,
&[
ctx.accounts.token_program_id,
ctx.accounts.program_id,
ctx.accounts.group,
ctx.accounts.mint,
ctx.accounts.mint_authority,
Expand All @@ -31,7 +31,7 @@ pub fn token_group_initialize<'info>(

#[derive(Accounts)]
pub struct TokenGroupInitialize<'info> {
pub token_program_id: AccountInfo<'info>,
pub program_id: AccountInfo<'info>,
pub group: AccountInfo<'info>,
pub mint: AccountInfo<'info>,
pub mint_authority: AccountInfo<'info>,
Expand All @@ -41,7 +41,7 @@ pub fn token_member_initialize<'info>(
ctx: CpiContext<'_, '_, '_, 'info, TokenMemberInitialize<'info>>,
) -> Result<()> {
let ix = spl_token_group_interface::instruction::initialize_member(
ctx.accounts.token_program_id.key,
ctx.accounts.program_id.key,
ctx.accounts.member.key,
ctx.accounts.member_mint.key,
ctx.accounts.member_mint_authority.key,
Expand All @@ -51,7 +51,7 @@ pub fn token_member_initialize<'info>(
anchor_lang::solana_program::program::invoke_signed(
&ix,
&[
ctx.accounts.token_program_id,
ctx.accounts.program_id,
ctx.accounts.member,
ctx.accounts.member_mint,
ctx.accounts.member_mint_authority,
Expand All @@ -65,7 +65,7 @@ pub fn token_member_initialize<'info>(

#[derive(Accounts)]
pub struct TokenMemberInitialize<'info> {
pub token_program_id: AccountInfo<'info>,
pub program_id: AccountInfo<'info>,
pub member: AccountInfo<'info>,
pub member_mint: AccountInfo<'info>,
pub member_mint_authority: AccountInfo<'info>,
Expand Down
18 changes: 9 additions & 9 deletions spl/src/token_2022_extensions/token_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn token_metadata_initialize<'info>(
uri: String,
) -> Result<()> {
let ix = spl_token_metadata_interface::instruction::initialize(
ctx.accounts.token_program_id.key,
ctx.accounts.program_id.key,
ctx.accounts.metadata.key,
ctx.accounts.update_authority.key,
ctx.accounts.mint.key,
Expand All @@ -25,7 +25,7 @@ pub fn token_metadata_initialize<'info>(
anchor_lang::solana_program::program::invoke_signed(
&ix,
&[
ctx.accounts.token_program_id,
ctx.accounts.program_id,
ctx.accounts.metadata,
ctx.accounts.update_authority,
ctx.accounts.mint,
Expand All @@ -38,7 +38,7 @@ pub fn token_metadata_initialize<'info>(

#[derive(Accounts)]
pub struct TokenMetadataInitialize<'info> {
pub token_program_id: AccountInfo<'info>,
pub program_id: AccountInfo<'info>,
pub metadata: AccountInfo<'info>,
pub update_authority: AccountInfo<'info>,
pub mint_authority: AccountInfo<'info>,
Expand All @@ -50,15 +50,15 @@ pub fn token_metadata_update_authority<'info>(
new_authority: OptionalNonZeroPubkey,
) -> Result<()> {
let ix = spl_token_metadata_interface::instruction::update_authority(
ctx.accounts.token_program_id.key,
ctx.accounts.program_id.key,
ctx.accounts.metadata.key,
ctx.accounts.current_authority.key,
new_authority,
);
anchor_lang::solana_program::program::invoke_signed(
&ix,
&[
ctx.accounts.token_program_id,
ctx.accounts.program_id,
ctx.accounts.metadata,
ctx.accounts.current_authority,
],
Expand All @@ -69,7 +69,7 @@ pub fn token_metadata_update_authority<'info>(

#[derive(Accounts)]
pub struct TokenMetadataUpdateAuthority<'info> {
pub token_program_id: AccountInfo<'info>,
pub program_id: AccountInfo<'info>,
pub metadata: AccountInfo<'info>,
pub current_authority: AccountInfo<'info>,
pub new_authority: AccountInfo<'info>,
Expand All @@ -81,7 +81,7 @@ pub fn token_metadata_update_field<'info>(
value: String,
) -> Result<()> {
let ix = spl_token_metadata_interface::instruction::update_field(
ctx.accounts.token_program_id.key,
ctx.accounts.program_id.key,
ctx.accounts.metadata.key,
ctx.accounts.update_authority.key,
field,
Expand All @@ -90,7 +90,7 @@ pub fn token_metadata_update_field<'info>(
anchor_lang::solana_program::program::invoke_signed(
&ix,
&[
ctx.accounts.token_program_id,
ctx.accounts.program_id,
ctx.accounts.metadata,
ctx.accounts.update_authority,
],
Expand All @@ -101,7 +101,7 @@ pub fn token_metadata_update_field<'info>(

#[derive(Accounts)]
pub struct TokenMetadataUpdateField<'info> {
pub token_program_id: AccountInfo<'info>,
pub program_id: AccountInfo<'info>,
pub metadata: AccountInfo<'info>,
pub update_authority: AccountInfo<'info>,
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<'info> CreateMintAccount<'info> {
uri: String,
) -> ProgramResult {
let cpi_accounts = TokenMetadataInitialize {
token_program_id: self.token_program.to_account_info(),
program_id: self.token_program.to_account_info(),
mint: self.mint.to_account_info(),
metadata: self.mint.to_account_info(), // metadata account is the mint, since data is stored in mint
mint_authority: self.authority.to_account_info(),
Expand Down
Loading