Skip to content

Commit

Permalink
Merge pull request #170 from grooviegermanikus/update-fixed-library
Browse files Browse the repository at this point in the history
Update fixed library
  • Loading branch information
skrrb authored Sep 25, 2023
2 parents 6808285 + 2a8061b commit 4a91be3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "3rdparty/fixed"]
path = 3rdparty/fixed
url = https://gitlab.com/ckamm/fixed.git
[submodule "3rdparty/anchor"]
path = 3rdparty/anchor
url = https://github.com/openbook-dex/anchor.git
Expand Down
1 change: 0 additions & 1 deletion 3rdparty/fixed
Submodule fixed deleted from 95bf61
5 changes: 2 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [
anchor-client = "0.28.0"
anchor-lang = "0.28.0"
anchor-spl = "0.28.0"
fixed = {path = "./3rdparty/fixed", version = "1.11.0"}
fixed = { git = "https://github.com/blockworks-foundation/fixed.git", branch = "v1.11.0-borsh0_10-mango" }
pyth-sdk-solana = "0.8.0"
solana-account-decoder = "~1.16.1"
solana-client = "~1.16.1"
Expand Down
10 changes: 10 additions & 0 deletions programs/openbook-v2/src/i80f48.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use fixed::types::I80F48;

// regression test for https://gitlab.com/tspiteri/fixed/-/issues/57
// see https://github.com/blockworks-foundation/fixed/issues/1
#[test]
fn bug_fixed_comparison_u64() {
let a: u64 = 66000;
let b: u64 = 1000;
assert!(I80F48::from(a) > b); // fails!
}
1 change: 1 addition & 0 deletions programs/openbook-v2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub mod pubkey_option;
pub mod state;
pub mod token_utils;
pub mod types;
mod i80f48;

#[cfg(feature = "enable-gpl")]
pub mod instructions;
Expand Down

0 comments on commit 4a91be3

Please sign in to comment.