Skip to content

Commit 7c74e5d

Browse files
committed
Update ChainId inner representation to Felt
1 parent b85bf99 commit 7c74e5d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use once_cell::sync::Lazy;
99
use primitive_types::H160;
1010
use serde::{Deserialize, Serialize};
1111
use starknet_crypto::FieldElement;
12+
use starknet_types_core::felt::Felt;
1213

1314
use crate::crypto::PublicKey;
1415
use crate::hash::{pedersen_hash_array, PoseidonHash, StarkFelt, StarkHash};
@@ -18,11 +19,11 @@ use crate::{impl_from_through_intermediate, StarknetApiError};
1819

1920
/// A chain id.
2021
#[derive(Clone, Debug, Display, Eq, PartialEq, Hash, Deserialize, Serialize, PartialOrd, Ord)]
21-
pub struct ChainId(pub String);
22+
pub struct ChainId(pub Felt);
2223

2324
impl ChainId {
2425
pub fn as_hex(&self) -> String {
25-
format!("0x{}", hex::encode(&self.0))
26+
format!("0x{}", hex::encode(&self.0.to_string()))
2627
}
2728
}
2829

0 commit comments

Comments
 (0)