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

Commit d0f238f

Browse files
authored
Extract spl-math-utils from spl-math (#7421)
* extract math-utils from spl-math * newline * replace spl-math with spl-math-utils in spl-token-swap * remove now-unused deps from spl-math * remove spl-math from stake-pool deps (it was already unused) * fix math-utils dep in spl-token-swap-fuzz * moce crate dirs * make spl-math the library crate and spl-math-example the program crate
1 parent 356ef02 commit d0f238f

File tree

16 files changed

+68
-34
lines changed

16 files changed

+68
-34
lines changed

Cargo.lock

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ members = [
3636
"libraries/discriminator",
3737
"libraries/concurrent-merkle-tree",
3838
"libraries/math",
39+
"libraries/math-example",
3940
"libraries/merkle-tree-reference",
4041
"libraries/pod",
4142
"libraries/program-error",

libraries/math-example/Cargo.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[package]
2+
name = "spl-math-example"
3+
version = "0.1.0"
4+
description = "Solana Program Library Math Example"
5+
authors = ["Solana Labs Maintainers <[email protected]>"]
6+
repository = "https://github.com/solana-labs/solana-program-library"
7+
license = "Apache-2.0"
8+
edition = "2021"
9+
10+
[features]
11+
no-entrypoint = []
12+
test-sbf = []
13+
14+
[dependencies]
15+
borsh = "1.5.1"
16+
num-derive = "0.4"
17+
num-traits = "0.2"
18+
solana-program = "2.1.0"
19+
spl-math = { path = "../math", version = "0.3.0" }
20+
thiserror = "1.0"
21+
22+
[dev-dependencies]
23+
solana-program-test = "2.1.0"
24+
solana-sdk = "2.1.0"
25+
26+
[lib]
27+
crate-type = ["cdylib", "lib"]
28+
29+
30+
[package.metadata.docs.rs]
31+
targets = ["x86_64-unknown-linux-gnu"]

libraries/math-example/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Math
2+
3+
Program wrapper around the spl-math-utils crate. The program exists for testing purposes.
4+
5+
## Audit
6+
7+
The repository [README](https://github.com/solana-labs/solana-program-library#audits)
8+
contains information about program audits.
File renamed without changes.
File renamed without changes.

libraries/math-example/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//! Math operations using unsigned integers
2+
3+
#![deny(missing_docs)]
4+
#![forbid(unsafe_code)]
5+
6+
mod entrypoint;
7+
pub mod error;
8+
pub mod instruction;
9+
pub mod processor;
10+
11+
pub use spl_math::{approximations, checked_ceil_div, precise_number, uint};
12+
13+
solana_program::declare_id!("Math111111111111111111111111111111111111111");

0 commit comments

Comments
 (0)