Skip to content

Commit

Permalink
Responding to feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
blockiosaurus committed Jan 26, 2024
1 parent da6ebef commit a4f35d6
Show file tree
Hide file tree
Showing 24 changed files with 92 additions and 89 deletions.
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/addAuthority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/allocate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/clearData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/close.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/createShard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/setMint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/writeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 5 additions & 7 deletions clients/js/test/setMint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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());
Expand All @@ -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, {
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand All @@ -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,
Expand All @@ -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' });
});
10 changes: 5 additions & 5 deletions clients/rust/src/generated/instructions/add_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<solana_program::pubkey::Pubkey>,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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>>,
Expand All @@ -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>>,
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions clients/rust/src/generated/instructions/allocate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<solana_program::pubkey::Pubkey>,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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>>,
Expand All @@ -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>>,
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions clients/rust/src/generated/instructions/clear_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<solana_program::pubkey::Pubkey>,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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>>,
Expand All @@ -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>>,
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions clients/rust/src/generated/instructions/close.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<solana_program::pubkey::Pubkey>,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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>>,
Expand All @@ -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>>,
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions clients/rust/src/generated/instructions/create_shard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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>,
Expand All @@ -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>,
Expand Down Expand Up @@ -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);
Expand Down
Loading

0 comments on commit a4f35d6

Please sign in to comment.