mirror of
https://github.com/d0zingcat/ore.git
synced 2026-06-14 07:36:51 +00:00
fix depoy
This commit is contained in:
@@ -157,16 +157,16 @@ async fn ata(
|
||||
rpc: &RpcClient,
|
||||
payer: &solana_sdk::signer::keypair::Keypair,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
let user = pubkey!("BQbXD9tqv3ysrvojSZao2RoW9ucR4RmiKbKEaVWJp4J3");
|
||||
let user = pubkey!("Gmc26GMnhE3AWwdAQpxxsQPo6UYaob4wPRxUpmDsujoX");
|
||||
let token = pubkey!("8H8rPiWW4iTFCfEkSnf7jpqeNpFfvdH9gLouAL3Fe2Zx");
|
||||
let ata = get_associated_token_address(&user, &token);
|
||||
// let ix = spl_associated_token_account::instruction::create_associated_token_account(
|
||||
// &payer.pubkey(),
|
||||
// &user,
|
||||
// &token,
|
||||
// &spl_token::ID,
|
||||
// );
|
||||
// submit_transaction(rpc, payer, &[ix]).await?;
|
||||
let ix = spl_associated_token_account::instruction::create_associated_token_account(
|
||||
&payer.pubkey(),
|
||||
&user,
|
||||
&token,
|
||||
&spl_token::ID,
|
||||
);
|
||||
submit_transaction(rpc, payer, &[ix]).await?;
|
||||
let account = rpc.get_account(&ata).await?;
|
||||
println!("ATA: {}", ata);
|
||||
println!("Account: {:?}", account);
|
||||
@@ -224,8 +224,8 @@ async fn bury(
|
||||
let amount_u64 = ui_amount_to_amount(amount_f64, TOKEN_DECIMALS);
|
||||
let wrap_ix = ore_api::sdk::wrap(payer.pubkey());
|
||||
let bury_ix = ore_api::sdk::bury(payer.pubkey(), amount_u64);
|
||||
submit_transaction(rpc, payer, &[wrap_ix, bury_ix]).await?;
|
||||
// simulate_transaction(rpc, payer, &[wrap_ix, bury_ix]).await;
|
||||
// submit_transaction(rpc, payer, &[wrap_ix, bury_ix]).await?;
|
||||
simulate_transaction(rpc, payer, &[wrap_ix, bury_ix]).await;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -94,8 +94,8 @@ pub fn process_deploy(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResul
|
||||
miner.cumulative = [0; 25];
|
||||
miner.rewards_sol = 0;
|
||||
miner.rewards_ore = 0;
|
||||
miner.round_id = round.id;
|
||||
miner.checkpoint_id = round.id;
|
||||
miner.round_id = 0;
|
||||
miner.checkpoint_id = 0;
|
||||
miner.lifetime_rewards_sol = 0;
|
||||
miner.lifetime_rewards_ore = 0;
|
||||
miner
|
||||
|
||||
@@ -12,7 +12,7 @@ pub fn process_wrap(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult
|
||||
signer_info.is_signer()?;
|
||||
config_info
|
||||
.as_account::<Config>(&ore_api::ID)?
|
||||
.assert(|c| c.admin == *signer_info.key)?;
|
||||
.assert(|c| c.bury_authority == *signer_info.key)?;
|
||||
let treasury = treasury_info.as_account_mut::<Treasury>(&ore_api::ID)?;
|
||||
treasury_sol_info
|
||||
.is_writable()?
|
||||
|
||||
Reference in New Issue
Block a user