use solana_instruction::AccountMeta;
use solana_pubkey::Pubkey;
use crate::builders::SLOT_HASHES_ID;
pub const RNG_PROGRAM_ID: Pubkey = Pubkey::from_str_const("SatRngpc6hC9uMXqS4dRk4trqhySktoxMXYSSRbjemd");
pub const ROUND_ROTOR_TAG: &[u8] = b"round";
pub const EPOCH_ROTOR_TAG: &[u8] = b"epoch";
pub const BTC_ROTOR_TAG: &[u8] = b"btc";
pub fn get_rng_config_address() -> (Pubkey, u8) {
Pubkey::find_program_address(&[b"config"], &RNG_PROGRAM_ID)
}
pub fn get_rotor_address(tag: &[u8]) -> (Pubkey, u8) {
Pubkey::find_program_address(&[b"rotor", tag], &RNG_PROGRAM_ID)
}
pub fn get_rng_remaining_accounts_for(tag: &[u8]) -> Vec<AccountMeta> {
vec![
AccountMeta::new(get_rotor_address(tag).0, false),
AccountMeta::new_readonly(get_rng_config_address().0, false),
AccountMeta::new_readonly(RNG_PROGRAM_ID, false),
AccountMeta::new_readonly(SLOT_HASHES_ID, false),
]
}
pub fn get_rng_remaining_accounts() -> Vec<AccountMeta> {
get_rng_remaining_accounts_for(ROUND_ROTOR_TAG)
}