Skip to content

Commit

Permalink
More coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Aug 15, 2024
1 parent 4763fd8 commit da23798
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tree_hash/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy_primitives::{U128, U256};
use alloy_primitives::{Address, U128, U160, U256};
use ssz_derive::Encode;
use tree_hash::{Hash256, MerkleHasher, PackedEncoding, TreeHash, BYTES_PER_CHUNK};
use tree_hash_derive::TreeHash;
Expand Down Expand Up @@ -151,10 +151,22 @@ fn packed_encoding_example() {
(
Hash256::from_slice(U256::from(val).as_le_slice())
.tree_hash_root()
.to_vec()
.0
.into(),
0,
),
(U256::from(val).tree_hash_root().0.into(), 0),
(
Address::from(U160::from(val).to_le_bytes::<20>())
.tree_hash_root()
.0
.into(),
0,
),
(
Address::from(U160::from(val).to_le_bytes::<20>()).tree_hash_packed_encoding(),
0,
),
];
for (i, (encoding, offset)) in encodings.into_iter().enumerate() {
assert_eq!(
Expand Down

0 comments on commit da23798

Please sign in to comment.