Skip to content

Commit

Permalink
serialize felt as hex
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyBuisset committed Jan 22, 2024
1 parent 833626c commit f28bfd8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions common/domain/src/value_objects/blockchain/starknet.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use std::fmt::Display;

use derive_more::{From, FromStr, Into};
use serde::{Deserialize, Serialize};
use serde_with::{DeserializeFromStr, SerializeDisplay};
use starknet_ff::FieldElement;

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, From, Into, FromStr)]
#[serde(transparent)]
#[derive(
Debug, Clone, PartialEq, Eq, SerializeDisplay, DeserializeFromStr, From, Into, FromStr,
)]
pub struct Address(FieldElement);

impl Display for Address {
Expand All @@ -14,8 +15,9 @@ impl Display for Address {
}
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, From, Into, FromStr)]
#[serde(transparent)]
#[derive(
Debug, Clone, PartialEq, Eq, SerializeDisplay, DeserializeFromStr, From, Into, FromStr,
)]
pub struct TransactionHash(FieldElement);

impl Display for TransactionHash {
Expand Down

0 comments on commit f28bfd8

Please sign in to comment.