Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaiton committed Aug 13, 2024
1 parent 8167307 commit 70e9ddf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/hyperdrive-math/src/short/max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ impl State {
/// ```math
/// e(x) = e_0 - max(e_{c}, 0)
/// ```
fn solvency_after_short(
pub fn solvency_after_short(
&self,
bond_amount: FixedPoint<U256>,
checkpoint_exposure: I256,
Expand Down
13 changes: 10 additions & 3 deletions crates/hyperdrive-math/src/short/targeted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,17 @@ impl State {

#[cfg(test)]
mod tests {
use hyperdrive_test_utils::constants::FAST_FUZZ_RUNS;
use rand::{thread_rng, Rng};
use hyperdrive_test_utils::{
chain::TestChain,
constants::{FAST_FUZZ_RUNS, SLOW_FUZZ_RUNS},
};
use rand::{thread_rng, Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;

use super::*;
use crate::test_utils::{
agent::HyperdriveMathAgent, preamble::initialize_pool_with_random_state,
};

#[tokio::test]
async fn fuzz_short_trade_deltas_from_reserves() -> Result<()> {
Expand Down Expand Up @@ -481,7 +488,7 @@ mod tests {
// Run the preamble and get state information.
initialize_pool_with_random_state(&mut rng, &mut alice, &mut bob, &mut celine).await?;
let current_state = alice.get_state().await?;
let min_spot_price_before_short = current_state.calculate_min_price()?;
let min_spot_price_before_short = current_state.calculate_min_spot_price()?;

// Get a targeted short amount.
let target_rate = current_state.calculate_spot_rate()?
Expand Down

0 comments on commit 70e9ddf

Please sign in to comment.