From a70ec442bdece91e5be57487a12a505f4221cd18 Mon Sep 17 00:00:00 2001 From: 0xPlish Date: Mon, 15 Sep 2025 10:53:03 -0700 Subject: [PATCH 1/2] add serde to UFixValue64 --- Cargo.toml | 1 + src/fix_value.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index becb971..e9b0813 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,4 +23,5 @@ muldiv = "1.0.1" num-traits = "0.2.17" paste = "1.0.14" quote = "1.0.36" +serde = { version = "1.0.224", features = ["derive"] } typenum = { version = "1.17.0", features = ["i128"] } diff --git a/src/fix_value.rs b/src/fix_value.rs index 05f40e3..0bcda74 100644 --- a/src/fix_value.rs +++ b/src/fix_value.rs @@ -4,13 +4,14 @@ use crate::Fix; use anchor_lang::error::ErrorCode::InvalidNumericConversion; use anchor_lang::prelude::{borsh, AnchorDeserialize, AnchorSerialize, InitSpace, Result}; use paste::paste; +use serde::{Deserialize, Serialize}; macro_rules! impl_fix_value { ($sign:ident, $bits:expr) => { paste! { /// A value-space `Fix` where base is always 10 and bits are a concrete type. /// Intended for serialized storage in Solana accounts where generics won't work. - #[derive(PartialEq, Eq, Copy, Clone, Debug, AnchorSerialize, AnchorDeserialize, InitSpace)] + #[derive(PartialEq, Eq, Copy, Clone, Debug, Serialize, Deserialize, AnchorSerialize, AnchorDeserialize, InitSpace)] pub struct [<$sign FixValue $bits>] { pub bits: [<$sign:lower $bits>], pub exp: i8, From 8b1d91cd69fc03e60be82363e3562e35dfc44e7e Mon Sep 17 00:00:00 2001 From: 0xPlish Date: Mon, 15 Sep 2025 10:53:25 -0700 Subject: [PATCH 2/2] bump version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e9b0813..b291a95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hylo-fix" -version = "0.4.1" +version = "0.4.2" edition = "2021" description = "Fixed-point number types with Solana Anchor support" authors = ["0xPlish ", "Curtis McEnroe "]