mirror of
https://github.com/d0zingcat/ore.git
synced 2026-06-05 23:26:46 +00:00
fix metadata testing issue
This commit is contained in:
@@ -385,7 +385,7 @@ pub fn initialize(signer: Pubkey) -> Instruction {
|
|||||||
AccountMeta::new_readonly(system_program::id(), false),
|
AccountMeta::new_readonly(system_program::id(), false),
|
||||||
AccountMeta::new_readonly(spl_token::id(), false),
|
AccountMeta::new_readonly(spl_token::id(), false),
|
||||||
AccountMeta::new_readonly(spl_associated_token_account::id(), false),
|
AccountMeta::new_readonly(spl_associated_token_account::id(), false),
|
||||||
// AccountMeta::new_readonly(mpl_token_metadata::ID, false),
|
AccountMeta::new_readonly(mpl_token_metadata::ID, false),
|
||||||
AccountMeta::new_readonly(sysvar::rent::id(), false),
|
AccountMeta::new_readonly(sysvar::rent::id(), false),
|
||||||
],
|
],
|
||||||
data: [
|
data: [
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ use crate::{
|
|||||||
utils::create_pda,
|
utils::create_pda,
|
||||||
utils::AccountDeserialize,
|
utils::AccountDeserialize,
|
||||||
utils::Discriminator,
|
utils::Discriminator,
|
||||||
BUS, BUS_COUNT, CONFIG, INITIAL_BASE_REWARD_RATE, INITIAL_TOLERANCE, METADATA, MINT,
|
BUS, BUS_COUNT, CONFIG, INITIAL_BASE_REWARD_RATE, INITIAL_TOLERANCE, METADATA, METADATA_NAME,
|
||||||
MINT_ADDRESS, MINT_NOISE, TOKEN_DECIMALS, TREASURY,
|
METADATA_SYMBOL, METADATA_URI, MINT, MINT_ADDRESS, MINT_NOISE, TOKEN_DECIMALS, TREASURY,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Initialize sets up the Ore program. Its responsibilities include:
|
/// Initialize sets up the Ore program. Its responsibilities include:
|
||||||
@@ -48,8 +48,7 @@ pub fn process_initialize<'a, 'info>(
|
|||||||
let args = InitializeArgs::try_from_bytes(data)?;
|
let args = InitializeArgs::try_from_bytes(data)?;
|
||||||
|
|
||||||
// Load accounts
|
// Load accounts
|
||||||
// let [signer, bus_0_info, bus_1_info, bus_2_info, bus_3_info, bus_4_info, bus_5_info, bus_6_info, bus_7_info, config_info, metadata_info, mint_info, treasury_info, treasury_tokens_info, system_program, token_program, associated_token_program, metadata_program, rent_sysvar] =
|
let [signer, bus_0_info, bus_1_info, bus_2_info, bus_3_info, bus_4_info, bus_5_info, bus_6_info, bus_7_info, config_info, metadata_info, mint_info, treasury_info, treasury_tokens_info, system_program, token_program, associated_token_program, metadata_program, rent_sysvar] =
|
||||||
let [signer, bus_0_info, bus_1_info, bus_2_info, bus_3_info, bus_4_info, bus_5_info, bus_6_info, bus_7_info, config_info, metadata_info, mint_info, treasury_info, treasury_tokens_info, system_program, token_program, associated_token_program, rent_sysvar] =
|
|
||||||
accounts
|
accounts
|
||||||
else {
|
else {
|
||||||
return Err(ProgramError::NotEnoughAccountKeys);
|
return Err(ProgramError::NotEnoughAccountKeys);
|
||||||
@@ -85,7 +84,7 @@ pub fn process_initialize<'a, 'info>(
|
|||||||
load_program(system_program, system_program::id())?;
|
load_program(system_program, system_program::id())?;
|
||||||
load_program(token_program, spl_token::id())?;
|
load_program(token_program, spl_token::id())?;
|
||||||
load_program(associated_token_program, spl_associated_token_account::id())?;
|
load_program(associated_token_program, spl_associated_token_account::id())?;
|
||||||
// load_program(metadata_program, mpl_token_metadata::ID)?;
|
load_program(metadata_program, mpl_token_metadata::ID)?;
|
||||||
load_sysvar(rent_sysvar, sysvar::rent::id())?;
|
load_sysvar(rent_sysvar, sysvar::rent::id())?;
|
||||||
|
|
||||||
// Initialize bus accounts
|
// Initialize bus accounts
|
||||||
@@ -179,32 +178,31 @@ pub fn process_initialize<'a, 'info>(
|
|||||||
&[&[MINT, MINT_NOISE.as_slice(), &[args.mint_bump]]],
|
&[&[MINT, MINT_NOISE.as_slice(), &[args.mint_bump]]],
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
// TODO Fix metadata initialization
|
|
||||||
// Initialize mint metadata
|
// Initialize mint metadata
|
||||||
// mpl_token_metadata::instructions::CreateMetadataAccountV3Cpi {
|
mpl_token_metadata::instructions::CreateMetadataAccountV3Cpi {
|
||||||
// __program: metadata_program,
|
__program: metadata_program,
|
||||||
// metadata: metadata_info,
|
metadata: metadata_info,
|
||||||
// mint: mint_info,
|
mint: mint_info,
|
||||||
// mint_authority: treasury_info,
|
mint_authority: treasury_info,
|
||||||
// payer: signer,
|
payer: signer,
|
||||||
// update_authority: (signer, true),
|
update_authority: (signer, true),
|
||||||
// system_program,
|
system_program,
|
||||||
// rent: Some(rent_sysvar),
|
rent: Some(rent_sysvar),
|
||||||
// __args: mpl_token_metadata::instructions::CreateMetadataAccountV3InstructionArgs {
|
__args: mpl_token_metadata::instructions::CreateMetadataAccountV3InstructionArgs {
|
||||||
// data: mpl_token_metadata::types::DataV2 {
|
data: mpl_token_metadata::types::DataV2 {
|
||||||
// name: METADATA_NAME.to_string(),
|
name: METADATA_NAME.to_string(),
|
||||||
// symbol: METADATA_SYMBOL.to_string(),
|
symbol: METADATA_SYMBOL.to_string(),
|
||||||
// uri: METADATA_URI.to_string(),
|
uri: METADATA_URI.to_string(),
|
||||||
// seller_fee_basis_points: 0,
|
seller_fee_basis_points: 0,
|
||||||
// creators: None,
|
creators: None,
|
||||||
// collection: None,
|
collection: None,
|
||||||
// uses: None,
|
uses: None,
|
||||||
// },
|
},
|
||||||
// is_mutable: true,
|
is_mutable: true,
|
||||||
// collection_details: None,
|
collection_details: None,
|
||||||
// },
|
},
|
||||||
// }
|
}
|
||||||
// .invoke_signed(&[&[TREASURY, &[args.treasury_bump]]])?;
|
.invoke_signed(&[&[TREASURY, &[args.treasury_bump]]])?;
|
||||||
|
|
||||||
// Initialize treasury token account
|
// Initialize treasury token account
|
||||||
solana_program::program::invoke(
|
solana_program::program::invoke(
|
||||||
|
|||||||
Reference in New Issue
Block a user