Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 671922f

Browse files
committed
replace spl-math with spl-math-utils in spl-token-swap
1 parent b9e65ab commit 671922f

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

token-swap/program/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ enum_dispatch = "0.3.13"
1818
num-derive = "0.4"
1919
num-traits = "0.2"
2020
solana-program = "2.1.0"
21-
spl-math = { version = "0.3", path = "../../libraries/math", features = [ "no-entrypoint" ] }
21+
spl-math-utils = { version = "0.1", path = "../../libraries/math-utils" }
2222
spl-token = { version = "6.0", path = "../../token/program", features = [ "no-entrypoint" ] }
2323
spl-token-2022 = { version = "5.0.2", path = "../../token/program-2022", features = [ "no-entrypoint" ] }
2424
thiserror = "1.0"

token-swap/program/fuzz/src/instructions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use {
33
arbitrary::Arbitrary,
44
honggfuzz::fuzz,
5-
spl_math::precise_number::PreciseNumber,
5+
spl_math_utils::precise_number::PreciseNumber,
66
spl_token::error::TokenError,
77
spl_token_swap::{
88
curve::{

token-swap/program/src/curve/calculator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
#[cfg(feature = "fuzz")]
44
use arbitrary::Arbitrary;
5-
use {crate::error::SwapError, spl_math::precise_number::PreciseNumber, std::fmt::Debug};
5+
use {crate::error::SwapError, spl_math_utils::precise_number::PreciseNumber, std::fmt::Debug};
66

77
/// Initial amount of pool tokens for swap contract, hard-coded to something
88
/// "sensible" given a maximum of u128.
@@ -194,7 +194,7 @@ pub trait CurveCalculator: Debug + DynPack {
194194
/// Test helpers for curves
195195
#[cfg(test)]
196196
pub mod test {
197-
use {super::*, proptest::prelude::*, spl_math::uint::U256};
197+
use {super::*, proptest::prelude::*, spl_math_utils::uint::U256};
198198

199199
/// The epsilon for most curves when performing the conversion test,
200200
/// comparing a one-sided deposit to a swap + deposit.

token-swap/program/src/curve/constant_price.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use {
1212
program_error::ProgramError,
1313
program_pack::{IsInitialized, Pack, Sealed},
1414
},
15-
spl_math::{checked_ceil_div::CheckedCeilDiv, precise_number::PreciseNumber, uint::U256},
15+
spl_math_utils::{checked_ceil_div::CheckedCeilDiv, precise_number::PreciseNumber, uint::U256},
1616
};
1717

1818
/// Get the amount of pool tokens for the given amount of token A or B.

token-swap/program/src/curve/constant_product.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use {
1212
program_error::ProgramError,
1313
program_pack::{IsInitialized, Pack, Sealed},
1414
},
15-
spl_math::{checked_ceil_div::CheckedCeilDiv, precise_number::PreciseNumber},
15+
spl_math_utils::{checked_ceil_div::CheckedCeilDiv, precise_number::PreciseNumber},
1616
};
1717

1818
/// ConstantProductCurve struct implementing CurveCalculator

token-swap/program/src/curve/offset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use {
1919
program_error::ProgramError,
2020
program_pack::{IsInitialized, Pack, Sealed},
2121
},
22-
spl_math::precise_number::PreciseNumber,
22+
spl_math_utils::precise_number::PreciseNumber,
2323
};
2424

2525
/// Offset curve, uses ConstantProduct under the hood, but adds an offset to

0 commit comments

Comments
 (0)