From a4f35d6c1535522291b8e048dc1c2829cba05bc1 Mon Sep 17 00:00:00 2001 From: blockiosaurus Date: Fri, 26 Jan 2024 07:54:29 -0500 Subject: [PATCH] Responding to feedback. --- .../generated/instructions/addAuthority.ts | 2 +- .../js/src/generated/instructions/allocate.ts | 2 +- .../src/generated/instructions/clearData.ts | 2 +- .../js/src/generated/instructions/close.ts | 2 +- .../src/generated/instructions/createShard.ts | 2 +- .../src/generated/instructions/initialize.ts | 2 +- .../initializeAssociatedInscription.ts | 2 +- .../instructions/initializeFromMint.ts | 2 +- .../js/src/generated/instructions/setMint.ts | 2 +- .../src/generated/instructions/writeData.ts | 2 +- clients/js/test/setMint.test.ts | 12 +++++------ .../generated/instructions/add_authority.rs | 10 +++++----- .../src/generated/instructions/allocate.rs | 10 +++++----- .../src/generated/instructions/clear_data.rs | 10 +++++----- .../rust/src/generated/instructions/close.rs | 10 +++++----- .../generated/instructions/create_shard.rs | 10 +++++----- .../src/generated/instructions/initialize.rs | 10 +++++----- .../initialize_associated_inscription.rs | 10 +++++----- .../instructions/initialize_from_mint.rs | 10 +++++----- .../src/generated/instructions/set_mint.rs | 10 +++++----- .../src/generated/instructions/write_data.rs | 10 +++++----- idls/mpl_inscription.json | 20 +++++++++---------- .../mpl-inscription/src/instruction/mod.rs | 20 +++++++++---------- .../mpl-inscription/src/processor/set_mint.rs | 9 +++++++-- 24 files changed, 92 insertions(+), 89 deletions(-) diff --git a/clients/js/src/generated/instructions/addAuthority.ts b/clients/js/src/generated/instructions/addAuthority.ts index d7407bf..187b777 100644 --- a/clients/js/src/generated/instructions/addAuthority.ts +++ b/clients/js/src/generated/instructions/addAuthority.ts @@ -31,7 +31,7 @@ import { export type AddAuthorityInstructionAccounts = { /** The account to store the metadata's metadata in. */ inscriptionMetadataAccount: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** The authority of the inscription account. */ authority?: Signer; diff --git a/clients/js/src/generated/instructions/allocate.ts b/clients/js/src/generated/instructions/allocate.ts index 8830362..af7305e 100644 --- a/clients/js/src/generated/instructions/allocate.ts +++ b/clients/js/src/generated/instructions/allocate.ts @@ -37,7 +37,7 @@ export type AllocateInstructionAccounts = { inscriptionAccount: PublicKey | Pda; /** The account to store the inscription account's metadata in. */ inscriptionMetadataAccount: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** The authority of the inscription account. */ authority?: Signer; diff --git a/clients/js/src/generated/instructions/clearData.ts b/clients/js/src/generated/instructions/clearData.ts index 46eb0ea..c09a9ed 100644 --- a/clients/js/src/generated/instructions/clearData.ts +++ b/clients/js/src/generated/instructions/clearData.ts @@ -36,7 +36,7 @@ export type ClearDataInstructionAccounts = { inscriptionAccount: PublicKey | Pda; /** The account to store the inscription account's metadata in. */ inscriptionMetadataAccount: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** The authority of the inscription account. */ authority?: Signer; diff --git a/clients/js/src/generated/instructions/close.ts b/clients/js/src/generated/instructions/close.ts index 106f2b9..d148074 100644 --- a/clients/js/src/generated/instructions/close.ts +++ b/clients/js/src/generated/instructions/close.ts @@ -36,7 +36,7 @@ export type CloseInstructionAccounts = { inscriptionAccount: PublicKey | Pda; /** The account to store the inscription account's metadata in. */ inscriptionMetadataAccount: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** The authority of the inscription account. */ authority?: Signer; diff --git a/clients/js/src/generated/instructions/createShard.ts b/clients/js/src/generated/instructions/createShard.ts index 05fe003..af41aa9 100644 --- a/clients/js/src/generated/instructions/createShard.ts +++ b/clients/js/src/generated/instructions/createShard.ts @@ -30,7 +30,7 @@ import { export type CreateShardInstructionAccounts = { /** The account to store the shard data in. */ shardAccount: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** System program */ systemProgram?: PublicKey | Pda; diff --git a/clients/js/src/generated/instructions/initialize.ts b/clients/js/src/generated/instructions/initialize.ts index dcc44df..1e47ce7 100644 --- a/clients/js/src/generated/instructions/initialize.ts +++ b/clients/js/src/generated/instructions/initialize.ts @@ -36,7 +36,7 @@ export type InitializeInstructionAccounts = { inscriptionMetadataAccount?: PublicKey | Pda; /** The shard account for the inscription counter. */ inscriptionShardAccount: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** The authority of the inscription account. */ authority?: Signer; diff --git a/clients/js/src/generated/instructions/initializeAssociatedInscription.ts b/clients/js/src/generated/instructions/initializeAssociatedInscription.ts index 1b537a1..f632688 100644 --- a/clients/js/src/generated/instructions/initializeAssociatedInscription.ts +++ b/clients/js/src/generated/instructions/initializeAssociatedInscription.ts @@ -41,7 +41,7 @@ export type InitializeAssociatedInscriptionInstructionAccounts = { inscriptionMetadataAccount?: PublicKey | Pda; /** The account to create and store the new associated data in. */ associatedInscriptionAccount?: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** The authority of the inscription account. */ authority?: Signer; diff --git a/clients/js/src/generated/instructions/initializeFromMint.ts b/clients/js/src/generated/instructions/initializeFromMint.ts index 7137f85..e75ada8 100644 --- a/clients/js/src/generated/instructions/initializeFromMint.ts +++ b/clients/js/src/generated/instructions/initializeFromMint.ts @@ -40,7 +40,7 @@ export type InitializeFromMintInstructionAccounts = { tokenMetadataAccount?: PublicKey | Pda; /** The shard account for the inscription counter. */ inscriptionShardAccount: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** The authority of the inscription account. */ authority?: Signer; diff --git a/clients/js/src/generated/instructions/setMint.ts b/clients/js/src/generated/instructions/setMint.ts index 7b0b14c..edc1887 100644 --- a/clients/js/src/generated/instructions/setMint.ts +++ b/clients/js/src/generated/instructions/setMint.ts @@ -34,7 +34,7 @@ export type SetMintInstructionAccounts = { inscriptionMetadataAccount: PublicKey | Pda; /** The mint that will be used to derive the PDA. */ mintAccount: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** System program */ systemProgram?: PublicKey | Pda; diff --git a/clients/js/src/generated/instructions/writeData.ts b/clients/js/src/generated/instructions/writeData.ts index b8ddda4..47e3cc9 100644 --- a/clients/js/src/generated/instructions/writeData.ts +++ b/clients/js/src/generated/instructions/writeData.ts @@ -39,7 +39,7 @@ export type WriteDataInstructionAccounts = { inscriptionAccount: PublicKey | Pda; /** The account to store the inscription account's metadata in. */ inscriptionMetadataAccount: PublicKey | Pda; - /** The account that will pay for the transaction and rent. */ + /** The account that will pay for the rent. */ payer?: Signer; /** The authority of the inscription account. */ authority?: Signer; diff --git a/clients/js/test/setMint.test.ts b/clients/js/test/setMint.test.ts index 314d8b1..0a90bb7 100644 --- a/clients/js/test/setMint.test.ts +++ b/clients/js/test/setMint.test.ts @@ -51,8 +51,6 @@ test('it can set the mint on a Mint Inscription account', async (t) => { inscriptionAccount: inscriptionAccount[0], }); - // const asset = await fetchDigitalAsset(umi, mint.publicKey); - let builder = new TransactionBuilder(); // When we create a new account. @@ -90,7 +88,7 @@ test('it can set the mint on a Mint Inscription account', async (t) => { }); }); -test('it cannot set the mint on an Inscription account', async (t) => { +test('it cannot set the mint on an Inscription account that is not derived from a mint', async (t) => { // Given a Umi instance and a new signer. const umi = await createUmi(); umi.use(mplTokenMetadata()); @@ -109,6 +107,7 @@ test('it cannot set the mint on an Inscription account', async (t) => { tokenStandard: TokenStandard.NonFungible, }).sendAndConfirm(umi); + // We are creating an inscription account that is not derived from a mint and is not a PDA. const inscriptionAccount = generateSigner(umi); const inscriptionMetadataAccount = await findInscriptionMetadataPda(umi, { @@ -157,6 +156,7 @@ test('it cannot set the wrong mint on a Mint Inscription account', async (t) => tokenStandard: TokenStandard.NonFungible, }).sendAndConfirm(umi); + // Create a second mint. const wrongMint = generateSigner(umi); await createV1(umi, { mint: wrongMint, @@ -178,8 +178,6 @@ test('it cannot set the wrong mint on a Mint Inscription account', async (t) => inscriptionAccount: inscriptionAccount[0], }); - // const asset = await fetchDigitalAsset(umi, mint.publicKey); - let builder = new TransactionBuilder(); // When we create a new account. @@ -189,7 +187,7 @@ test('it cannot set the wrong mint on a Mint Inscription account', async (t) => }) ); - // Set the mint on the account. + // It tries to set the mint to an invalid mint. builder = builder.append( setMint(umi, { mintInscriptionAccount: inscriptionAccount, @@ -200,6 +198,6 @@ test('it cannot set the wrong mint on a Mint Inscription account', async (t) => const promise = builder.sendAndConfirm(umi); - // Then an error is thrown. + // And it fails because the derivation from the wrong mint is invalid. await t.throwsAsync(promise, { name: 'DerivedKeyInvalid' }); }); diff --git a/clients/rust/src/generated/instructions/add_authority.rs b/clients/rust/src/generated/instructions/add_authority.rs index 73d6f7d..70116e0 100644 --- a/clients/rust/src/generated/instructions/add_authority.rs +++ b/clients/rust/src/generated/instructions/add_authority.rs @@ -13,7 +13,7 @@ use solana_program::pubkey::Pubkey; pub struct AddAuthority { /// The account to store the metadata's metadata in. pub inscription_metadata_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// The authority of the inscription account. pub authority: Option, @@ -110,7 +110,7 @@ impl AddAuthorityBuilder { self.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -180,7 +180,7 @@ impl AddAuthorityBuilder { pub struct AddAuthorityCpiAccounts<'a, 'b> { /// The account to store the metadata's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -194,7 +194,7 @@ pub struct AddAuthorityCpi<'a, 'b> { pub __program: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the metadata's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -339,7 +339,7 @@ impl<'a, 'b> AddAuthorityCpiBuilder<'a, 'b> { self.instruction.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/clients/rust/src/generated/instructions/allocate.rs b/clients/rust/src/generated/instructions/allocate.rs index 4516307..d8937d5 100644 --- a/clients/rust/src/generated/instructions/allocate.rs +++ b/clients/rust/src/generated/instructions/allocate.rs @@ -14,7 +14,7 @@ pub struct Allocate { pub inscription_account: solana_program::pubkey::Pubkey, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// The authority of the inscription account. pub authority: Option, @@ -127,7 +127,7 @@ impl AllocateBuilder { self.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -206,7 +206,7 @@ pub struct AllocateCpiAccounts<'a, 'b> { pub inscription_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -222,7 +222,7 @@ pub struct AllocateCpi<'a, 'b> { pub inscription_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -384,7 +384,7 @@ impl<'a, 'b> AllocateCpiBuilder<'a, 'b> { self.instruction.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/clients/rust/src/generated/instructions/clear_data.rs b/clients/rust/src/generated/instructions/clear_data.rs index 6ecf885..6e149c6 100644 --- a/clients/rust/src/generated/instructions/clear_data.rs +++ b/clients/rust/src/generated/instructions/clear_data.rs @@ -14,7 +14,7 @@ pub struct ClearData { pub inscription_account: solana_program::pubkey::Pubkey, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// The authority of the inscription account. pub authority: Option, @@ -125,7 +125,7 @@ impl ClearDataBuilder { self.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -198,7 +198,7 @@ pub struct ClearDataCpiAccounts<'a, 'b> { pub inscription_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -214,7 +214,7 @@ pub struct ClearDataCpi<'a, 'b> { pub inscription_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -375,7 +375,7 @@ impl<'a, 'b> ClearDataCpiBuilder<'a, 'b> { self.instruction.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/clients/rust/src/generated/instructions/close.rs b/clients/rust/src/generated/instructions/close.rs index a3518b9..9480674 100644 --- a/clients/rust/src/generated/instructions/close.rs +++ b/clients/rust/src/generated/instructions/close.rs @@ -14,7 +14,7 @@ pub struct Close { pub inscription_account: solana_program::pubkey::Pubkey, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// The authority of the inscription account. pub authority: Option, @@ -125,7 +125,7 @@ impl CloseBuilder { self.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -198,7 +198,7 @@ pub struct CloseCpiAccounts<'a, 'b> { pub inscription_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -214,7 +214,7 @@ pub struct CloseCpi<'a, 'b> { pub inscription_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -375,7 +375,7 @@ impl<'a, 'b> CloseCpiBuilder<'a, 'b> { self.instruction.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/clients/rust/src/generated/instructions/create_shard.rs b/clients/rust/src/generated/instructions/create_shard.rs index 5a639ce..e591da0 100644 --- a/clients/rust/src/generated/instructions/create_shard.rs +++ b/clients/rust/src/generated/instructions/create_shard.rs @@ -12,7 +12,7 @@ use borsh::BorshSerialize; pub struct CreateShard { /// The account to store the shard data in. pub shard_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// System program pub system_program: solana_program::pubkey::Pubkey, @@ -93,7 +93,7 @@ impl CreateShardBuilder { self.shard_account = Some(shard_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -150,7 +150,7 @@ impl CreateShardBuilder { pub struct CreateShardCpiAccounts<'a, 'b> { /// The account to store the shard data in. pub shard_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// System program pub system_program: &'b solana_program::account_info::AccountInfo<'a>, @@ -162,7 +162,7 @@ pub struct CreateShardCpi<'a, 'b> { pub __program: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the shard data in. pub shard_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// System program pub system_program: &'b solana_program::account_info::AccountInfo<'a>, @@ -289,7 +289,7 @@ impl<'a, 'b> CreateShardCpiBuilder<'a, 'b> { self.instruction.shard_account = Some(shard_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/clients/rust/src/generated/instructions/initialize.rs b/clients/rust/src/generated/instructions/initialize.rs index ae2279d..48bd0ac 100644 --- a/clients/rust/src/generated/instructions/initialize.rs +++ b/clients/rust/src/generated/instructions/initialize.rs @@ -16,7 +16,7 @@ pub struct Initialize { pub inscription_metadata_account: solana_program::pubkey::Pubkey, /// The shard account for the inscription counter. pub inscription_shard_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// The authority of the inscription account. pub authority: Option, @@ -128,7 +128,7 @@ impl InitializeBuilder { self.inscription_shard_account = Some(inscription_shard_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -197,7 +197,7 @@ pub struct InitializeCpiAccounts<'a, 'b> { pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, /// The shard account for the inscription counter. pub inscription_shard_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -215,7 +215,7 @@ pub struct InitializeCpi<'a, 'b> { pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, /// The shard account for the inscription counter. pub inscription_shard_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -385,7 +385,7 @@ impl<'a, 'b> InitializeCpiBuilder<'a, 'b> { self.instruction.inscription_shard_account = Some(inscription_shard_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/clients/rust/src/generated/instructions/initialize_associated_inscription.rs b/clients/rust/src/generated/instructions/initialize_associated_inscription.rs index 48367b5..187450f 100644 --- a/clients/rust/src/generated/instructions/initialize_associated_inscription.rs +++ b/clients/rust/src/generated/instructions/initialize_associated_inscription.rs @@ -16,7 +16,7 @@ pub struct InitializeAssociatedInscription { pub inscription_metadata_account: solana_program::pubkey::Pubkey, /// The account to create and store the new associated data in. pub associated_inscription_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// The authority of the inscription account. pub authority: Option, @@ -143,7 +143,7 @@ impl InitializeAssociatedInscriptionBuilder { self.associated_inscription_account = Some(associated_inscription_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -223,7 +223,7 @@ pub struct InitializeAssociatedInscriptionCpiAccounts<'a, 'b> { pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to create and store the new associated data in. pub associated_inscription_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -241,7 +241,7 @@ pub struct InitializeAssociatedInscriptionCpi<'a, 'b> { pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to create and store the new associated data in. pub associated_inscription_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -420,7 +420,7 @@ impl<'a, 'b> InitializeAssociatedInscriptionCpiBuilder<'a, 'b> { self.instruction.associated_inscription_account = Some(associated_inscription_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/clients/rust/src/generated/instructions/initialize_from_mint.rs b/clients/rust/src/generated/instructions/initialize_from_mint.rs index 70bfab1..cc38998 100644 --- a/clients/rust/src/generated/instructions/initialize_from_mint.rs +++ b/clients/rust/src/generated/instructions/initialize_from_mint.rs @@ -20,7 +20,7 @@ pub struct InitializeFromMint { pub token_metadata_account: solana_program::pubkey::Pubkey, /// The shard account for the inscription counter. pub inscription_shard_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// The authority of the inscription account. pub authority: Option, @@ -159,7 +159,7 @@ impl InitializeFromMintBuilder { self.inscription_shard_account = Some(inscription_shard_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -236,7 +236,7 @@ pub struct InitializeFromMintCpiAccounts<'a, 'b> { pub token_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, /// The shard account for the inscription counter. pub inscription_shard_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -258,7 +258,7 @@ pub struct InitializeFromMintCpi<'a, 'b> { pub token_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, /// The shard account for the inscription counter. pub inscription_shard_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -462,7 +462,7 @@ impl<'a, 'b> InitializeFromMintCpiBuilder<'a, 'b> { self.instruction.inscription_shard_account = Some(inscription_shard_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/clients/rust/src/generated/instructions/set_mint.rs b/clients/rust/src/generated/instructions/set_mint.rs index 0584003..3afdb99 100644 --- a/clients/rust/src/generated/instructions/set_mint.rs +++ b/clients/rust/src/generated/instructions/set_mint.rs @@ -16,7 +16,7 @@ pub struct SetMint { pub inscription_metadata_account: solana_program::pubkey::Pubkey, /// The mint that will be used to derive the PDA. pub mint_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// System program pub system_program: solana_program::pubkey::Pubkey, @@ -112,7 +112,7 @@ impl SetMintBuilder { self.mint_account = Some(mint_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -171,7 +171,7 @@ pub struct SetMintCpiAccounts<'a, 'b> { pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, /// The mint that will be used to derive the PDA. pub mint_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// System program pub system_program: &'b solana_program::account_info::AccountInfo<'a>, @@ -187,7 +187,7 @@ pub struct SetMintCpi<'a, 'b> { pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, /// The mint that will be used to derive the PDA. pub mint_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// System program pub system_program: &'b solana_program::account_info::AccountInfo<'a>, @@ -339,7 +339,7 @@ impl<'a, 'b> SetMintCpiBuilder<'a, 'b> { self.instruction.mint_account = Some(mint_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/clients/rust/src/generated/instructions/write_data.rs b/clients/rust/src/generated/instructions/write_data.rs index a1da6b5..1c324b7 100644 --- a/clients/rust/src/generated/instructions/write_data.rs +++ b/clients/rust/src/generated/instructions/write_data.rs @@ -14,7 +14,7 @@ pub struct WriteData { pub inscription_account: solana_program::pubkey::Pubkey, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: solana_program::pubkey::Pubkey, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: solana_program::pubkey::Pubkey, /// The authority of the inscription account. pub authority: Option, @@ -129,7 +129,7 @@ impl WriteDataBuilder { self.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { self.payer = Some(payer); @@ -214,7 +214,7 @@ pub struct WriteDataCpiAccounts<'a, 'b> { pub inscription_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -230,7 +230,7 @@ pub struct WriteDataCpi<'a, 'b> { pub inscription_account: &'b solana_program::account_info::AccountInfo<'a>, /// The account to store the inscription account's metadata in. pub inscription_metadata_account: &'b solana_program::account_info::AccountInfo<'a>, - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The authority of the inscription account. pub authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, @@ -393,7 +393,7 @@ impl<'a, 'b> WriteDataCpiBuilder<'a, 'b> { self.instruction.inscription_metadata_account = Some(inscription_metadata_account); self } - /// The account that will pay for the transaction and rent. + /// The account that will pay for the rent. #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { self.instruction.payer = Some(payer); diff --git a/idls/mpl_inscription.json b/idls/mpl_inscription.json index 8e16e77..85513e6 100644 --- a/idls/mpl_inscription.json +++ b/idls/mpl_inscription.json @@ -34,7 +34,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { @@ -109,7 +109,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { @@ -160,7 +160,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { @@ -218,7 +218,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { @@ -276,7 +276,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { @@ -326,7 +326,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { @@ -419,7 +419,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { @@ -476,7 +476,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { @@ -534,7 +534,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { @@ -600,7 +600,7 @@ "isMut": true, "isSigner": true, "docs": [ - "The account that will pay for the transaction and rent." + "The account that will pay for the rent." ] }, { diff --git a/programs/mpl-inscription/src/instruction/mod.rs b/programs/mpl-inscription/src/instruction/mod.rs index 47d95b1..c93d0c9 100644 --- a/programs/mpl-inscription/src/instruction/mod.rs +++ b/programs/mpl-inscription/src/instruction/mod.rs @@ -9,7 +9,7 @@ pub enum MplInscriptionInstruction { #[account(0, writable, signer, name="inscription_account", desc = "The account where data is stored.")] #[account(1, writable, name="inscription_metadata_account", desc = "The account to store the inscription account's metadata in.")] #[account(2, writable, name="inscription_shard_account", desc="The shard account for the inscription counter.")] - #[account(3, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(3, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(4, optional, signer, name="authority", desc="The authority of the inscription account.")] #[account(5, name="system_program", desc = "System program")] Initialize, @@ -20,7 +20,7 @@ pub enum MplInscriptionInstruction { #[account(2, name="mint_account", desc="The mint that will be used to derive the PDA.")] #[account(3, name="token_metadata_account", desc="The metadata for the mint.")] #[account(4, writable, name="inscription_shard_account", desc="The shard account for the inscription counter.")] - #[account(5, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(5, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(6, optional, signer, name="authority", desc="The authority of the inscription account.")] #[account(7, name="system_program", desc = "System program")] InitializeFromMint, @@ -28,7 +28,7 @@ pub enum MplInscriptionInstruction { /// Close the Inscription and Metadata accounts. #[account(0, writable, name="inscription_account", desc = "The account where data is stored.")] #[account(1, writable, name="inscription_metadata_account", desc = "The account to store the inscription account's metadata in.")] - #[account(2, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(2, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(3, optional, signer, name="authority", desc="The authority of the inscription account.")] #[account(4, name="system_program", desc = "System program")] Close(CloseArgs), @@ -36,7 +36,7 @@ pub enum MplInscriptionInstruction { /// Write data to the inscription account. #[account(0, writable, name="inscription_account", desc = "The account where data is stored.")] #[account(1, writable, name="inscription_metadata_account", desc = "The account to store the inscription account's metadata in.")] - #[account(2, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(2, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(3, optional, signer, name="authority", desc="The authority of the inscription account.")] #[account(4, name="system_program", desc = "System program")] WriteData(WriteDataArgs), @@ -44,14 +44,14 @@ pub enum MplInscriptionInstruction { /// Clear the inscription account. #[account(0, writable, name="inscription_account", desc = "The account where data is stored.")] #[account(1, writable, name="inscription_metadata_account", desc = "The account to store the inscription account's metadata in.")] - #[account(2, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(2, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(3, optional, signer, name="authority", desc="The authority of the inscription account.")] #[account(4, name="system_program", desc = "System program")] ClearData(ClearDataArgs), /// Add an update authority to the Inscription. #[account(0, writable, name="inscription_metadata_account", desc = "The account to store the metadata's metadata in.")] - #[account(1, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(1, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(2, optional, signer, name="authority", desc="The authority of the inscription account.")] #[account(3, name="system_program", desc = "System program")] AddAuthority(AddAuthorityArgs), @@ -65,7 +65,7 @@ pub enum MplInscriptionInstruction { /// Create an Inscription Shard account for counting inscriptions. #[account(0, writable, name="shard_account", desc = "The account to store the shard data in.")] - #[account(1, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(1, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(2, name="system_program", desc = "System program")] CreateShard(CreateShardArgs), @@ -73,7 +73,7 @@ pub enum MplInscriptionInstruction { #[account(0, name="inscription_account", desc = "The account where data is stored.")] #[account(1, writable, name="inscription_metadata_account", desc = "The account to store the inscription account's metadata in.")] #[account(2, writable, name="associated_inscription_account", desc = "The account to create and store the new associated data in.")] - #[account(3, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(3, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(4, optional, signer, name="authority", desc="The authority of the inscription account.")] #[account(5, name="system_program", desc = "System program")] InitializeAssociatedInscription(AssociateInscriptionAccountArgs), @@ -81,7 +81,7 @@ pub enum MplInscriptionInstruction { /// Allocate additional space for the inscription account. #[account(0, writable, name="inscription_account", desc = "The account where data is stored.")] #[account(1, writable, name="inscription_metadata_account", desc = "The account to store the inscription account's metadata in.")] - #[account(2, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(2, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(3, optional, signer, name="authority", desc="The authority of the inscription account.")] #[account(4, name="system_program", desc = "System program")] Allocate(AllocateArgs), @@ -90,7 +90,7 @@ pub enum MplInscriptionInstruction { #[account(0, name="mint_inscription_account", desc = "The account where data is stored.")] #[account(1, writable, name="inscription_metadata_account", desc = "The account to store the inscription account's metadata in.")] #[account(2, name="mint_account", desc="The mint that will be used to derive the PDA.")] - #[account(3, writable, signer, name="payer", desc="The account that will pay for the transaction and rent.")] + #[account(3, writable, signer, name="payer", desc="The account that will pay for the rent.")] #[account(4, name="system_program", desc = "System program")] SetMint, } diff --git a/programs/mpl-inscription/src/processor/set_mint.rs b/programs/mpl-inscription/src/processor/set_mint.rs index 21b43a9..2656ed2 100644 --- a/programs/mpl-inscription/src/processor/set_mint.rs +++ b/programs/mpl-inscription/src/processor/set_mint.rs @@ -16,6 +16,11 @@ use crate::{ pub(crate) fn process_set_mint<'a>(accounts: &'a [AccountInfo<'a>]) -> ProgramResult { let ctx = &SetMintAccounts::context(accounts)?; + // Check that the system program is correct. + if ctx.accounts.system_program.key != &solana_program::system_program::ID { + return Err(MplInscriptionError::InvalidSystemProgram.into()); + } + // Check that the account is already initialized. if ctx.accounts.mint_inscription_account.owner != &crate::ID { return Err(MplInscriptionError::NotInitialized.into()); @@ -34,7 +39,7 @@ pub(crate) fn process_set_mint<'a>(accounts: &'a [AccountInfo<'a>]) -> ProgramRe MplInscriptionError::IncorrectOwner, )?; - // Verify that the derived address is correct for the metadata account. + // Verify that the derived address is correct for the mint inscription account. let _inscription_bump = assert_derivation( &crate::ID, ctx.accounts.mint_inscription_account, @@ -60,7 +65,7 @@ pub(crate) fn process_set_mint<'a>(accounts: &'a [AccountInfo<'a>]) -> ProgramRe assert_signer(ctx.accounts.payer)?; - // Initialize the inscription metadata. + // Deserialize the inscription metadata. let mut inscription_metadata = InscriptionMetadata::try_from_slice( &ctx.accounts.inscription_metadata_account.data.borrow(), )?;