From f28bfd824def23f56691bbb548ed3d5d2d15dfb4 Mon Sep 17 00:00:00 2001 From: Anthony Buisset Date: Mon, 22 Jan 2024 15:26:58 +0100 Subject: [PATCH] serialize felt as hex --- .../domain/src/value_objects/blockchain/starknet.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/common/domain/src/value_objects/blockchain/starknet.rs b/common/domain/src/value_objects/blockchain/starknet.rs index caf4afd683..edab8397af 100644 --- a/common/domain/src/value_objects/blockchain/starknet.rs +++ b/common/domain/src/value_objects/blockchain/starknet.rs @@ -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 { @@ -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 {