Skip to content

Commit

Permalink
fix: serde arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgar2017 committed Sep 6, 2024
1 parent 9894ba6 commit d0c93a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions era-compiler-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ anyhow = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = [ "arbitrary_precision", "unbounded_depth" ] }
serde_stacker = "0.1"
serde_arrays = "0.1"

sha3 = "0.10"
hex = "0.4"
Expand Down
3 changes: 2 additions & 1 deletion era-compiler-common/src/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use sha3::Digest;
///
/// The hash.
///
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum Hash {
/// The `keccak256` hash.
Keccak256 {
Expand All @@ -23,6 +23,7 @@ pub enum Hash {
/// The `ipfs` hash.
Ipfs {
/// The byte representation.
#[serde(with = "serde_arrays")]
bytes: [u8; 2 + crate::BYTE_LENGTH_FIELD],
/// The string representation.
string: String,
Expand Down

0 comments on commit d0c93a7

Please sign in to comment.