use anchor_lang::prelude::*;
#[account]
#[derive(Copy, Debug, Default)]
pub struct MergePool {
pub primary_mint: Pubkey,
pub bump: u8,
pub replica_mint: Pubkey,
pub mm_count: u64,
pub total_primary_balance: u64,
pub total_replica_balance: u64,
pub reserved: [u64; 16],
}
impl MergePool {
pub const LEN: usize = 32 + 1 + 32 + 8 + 8 + 8 + 8 * 16;
}
#[account]
#[derive(Copy, Debug, Default)]
pub struct MergeMiner {
pub pool: Pubkey,
pub owner: Pubkey,
pub bump: u8,
pub index: u64,
pub primary_balance: u64,
pub replica_balance: u64,
}
impl MergeMiner {
pub const LEN: usize = 32 + 32 + 1 + 8 + 8 + 8;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_pool_len() {
assert_eq!(
MergePool::default().try_to_vec().unwrap().len(),
MergePool::LEN
);
}
#[test]
fn test_miner_len() {
assert_eq!(
MergeMiner::default().try_to_vec().unwrap().len(),
MergeMiner::LEN
);
}
}