solignition-cli 2.0.0

CLI tool for deploying Solana programs via the Solignition lending protocol
//! Shared test fixtures for the CLI integration suite.
//!
//! `solignition-cli` is a binary crate (no `[lib]`), so `tests/` files can't
//! `use solignition_cli::client::...` directly. We work around that with the
//! `#[path = "../../src/client.rs"]` include pattern in `tests/v1_client.rs`
//! -- nothing here needs to depend on that, it just bundles deterministic
//! key material and a tiny wiremock launcher.

use solana_sdk::signature::{Keypair, SeedDerivable};
use std::sync::Arc;
use wiremock::MockServer;

/// Deterministic 32-byte seed → Keypair so failing signatures are diffable in
/// CI logs. Same seed pattern as the unit-test fixture so the two suites
/// produce comparable signatures when debugging spec drift.
pub fn fixture_keypair() -> Keypair {
    let mut seed = [0u8; 32];
    for (i, b) in seed.iter_mut().enumerate() {
        *b = (i as u8).wrapping_mul(7).wrapping_add(13);
    }
    Keypair::from_seed(&seed).expect("valid 32-byte seed")
}

/// Spin up a wiremock server on a random port and return both the bound URL
/// and an `Arc<Keypair>` already wired with our deterministic test signer.
pub async fn mock_deployer() -> (MockServer, String, Arc<Keypair>) {
    let server = MockServer::start().await;
    let uri = server.uri();
    let signer = Arc::new(fixture_keypair());
    (server, uri, signer)
}