testsvm_quarry/setup.rs
1//! # Quarry Program Setup
2//!
3//! Utilities for initializing Quarry protocol programs in test environments.
4//!
5//! This module provides functions to easily set up all required Quarry programs
6//! (mine, merge_mine, and mint_wrapper) in a TestSVM environment. These programs
7//! must be downloaded as `.so` files before they can be loaded into the test environment.
8//!
9//! ## Required Programs
10//!
11//! - **quarry_mine**: Core mining and rewards distribution
12//! - **quarry_merge_mine**: Merge mining functionality for multiple quarries
13//! - **quarry_mint_wrapper**: Wrapped token minting capabilities
14
15use anyhow::Result;
16use testsvm::prelude::*;
17
18use crate::quarry_mine;
19
20/// Setup the quarry programs in the environment.
21///
22/// Note: you will need to download the Quarry programs to your `fixtures/programs/` directory.
23///
24/// You can use the following commands:
25/// ```bash
26/// solana program dump QMMD16kjauP5knBwxNUJRZ1Z5o3deBuFrqVjBVmmqto $ROOT_DIR/fixtures/programs/quarry_merge_mine.so
27/// solana program dump QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB $ROOT_DIR/fixtures/programs/quarry_mine.so
28/// solana program dump QMWoBmAyJLAsA1Lh9ugMTw2gciTihncciphzdNzdZYV $ROOT_DIR/fixtures/programs/quarry_mint_wrapper.so
29/// ```
30pub fn setup_quarry_programs(env: &mut TestSVM) -> Result<()> {
31 env.add_program_fixture("quarry_mine", quarry_mine::ID)?;
32 env.add_program_fixture("quarry_merge_mine", crate::quarry_merge_mine::ID)?;
33 env.add_program_fixture("quarry_mint_wrapper", crate::quarry_mint_wrapper::ID)?;
34 Ok(())
35}