Skip to content

Commit

Permalink
implement strict types and serde for fe128 type
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Nov 14, 2024
1 parent e9d1374 commit b00271f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ name = "zkaluvm"

[dependencies]
amplify = { version = "~4.8.0", default-features = false, features = ["derive"] }
strict_encoding = { version = "~2.8.0", default-features = false, features = ["derive"] }
aluvm = "0.12.0-beta.1"
serde = { version = "1", optional = true }

[features]
default = []
Expand All @@ -28,7 +30,7 @@ armor = ["aluvm/armor"]
std = ["aluvm/std", "amplify/std"]
log = ["aluvm/log"]
alloc = ["aluvm/alloc", "amplify/alloc"]
serde = ["aluvm/serde"]
serde = ["dep:serde", "aluvm/serde"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
Expand Down
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ extern crate alloc;

#[macro_use]
extern crate amplify;
#[macro_use]
extern crate strict_encoding;
#[cfg(feature = "serde")]
#[macro_use]
extern crate serde;

mod core;
pub mod gfa;
Expand All @@ -46,4 +51,7 @@ pub use self::core::{GfaCore, RegE};
#[allow(non_camel_case_types)]
#[derive(Copy, Clone, Eq, PartialEq, Debug, Display)]
#[display("{0:X}")]
#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)]
#[strict_type(lib = "FiniteField")]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct fe128(pub u128);

0 comments on commit b00271f

Please sign in to comment.