Skip to content

Commit

Permalink
Update crates/starknet-types-core/src/felt.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas @ StarkWare <[email protected]>
  • Loading branch information
damip and 0xLucqs authored Dec 21, 2023
1 parent 5444aac commit bbb4c7c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/starknet-types-core/src/felt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1760,11 +1760,10 @@ mod test {
use parity_scale_codec::{Decode, Encode};

// use an endianness-asymetric number to test that byte order is correct in serialization
let initial_felt: Felt = Felt::from_hex("0xabcdef123").unwrap().try_into().unwrap();
let initial_felt = Felt::from_hex("0xabcdef123").unwrap();

// serialize the felt
let mut serialized_felt = Vec::new();
initial_felt.encode_to(&mut serialized_felt);
let serialized_felt = initial_felt.encode();

// deserialize the felt
let deserialized_felt = Felt::decode(&mut &serialized_felt[..]).unwrap();
Expand Down

0 comments on commit bbb4c7c

Please sign in to comment.