This commit is contained in:
Hardhat Chad
2025-09-18 09:01:56 -07:00
parent 9f9be6b80e
commit 55666405ef
5 changed files with 3 additions and 82 deletions

View File

@@ -375,13 +375,6 @@ async fn get_miner(rpc: &RpcClient, authority: Pubkey) -> Result<Miner, anyhow::
Ok(*miner)
}
async fn get_miner_old(rpc: &RpcClient, authority: Pubkey) -> Result<MinerOLD, anyhow::Error> {
let miner_pda = ore_api::state::miner_pda(authority);
let account = rpc.get_account(&miner_pda.0).await?;
let miner = MinerOLD::try_from_bytes(&account.data)?;
Ok(*miner)
}
async fn get_clock(rpc: &RpcClient) -> Result<Clock, anyhow::Error> {
let data = rpc.get_account_data(&solana_sdk::sysvar::clock::ID).await?;
let clock = bincode::deserialize::<Clock>(&data)?;
@@ -393,11 +386,6 @@ async fn get_miners(rpc: &RpcClient) -> Result<Vec<(Pubkey, Miner)>, anyhow::Err
Ok(miners)
}
async fn get_miners_old(rpc: &RpcClient) -> Result<Vec<(Pubkey, MinerOLD)>, anyhow::Error> {
let miners = get_program_accounts::<MinerOLD>(rpc, ore_api::ID, vec![]).await?;
Ok(miners)
}
fn get_winning_square(slot_hash: &[u8]) -> u64 {
// Use slot hash to generate a random u64
let r1 = u64::from_le_bytes(slot_hash[0..8].try_into().unwrap());