Skip to content

Commit

Permalink
fix(primitives): hex macro re-export (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jan 4, 2025
1 parent a52894d commit c15f05e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/primitives/src/hex_literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ macro_rules! hex {
$crate::hex_literal::decode::<{ $crate::hex_literal::len(STRINGS) }>(STRINGS)
}};
}
#[doc(hidden)] // Use `crate::hex` directly instead!
pub use crate::hex;

#[cfg(test)]
mod tests {
Expand Down
10 changes: 8 additions & 2 deletions tests/core-sol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ pub mod no_missing_docs {

#[test]
fn do_stuff() {
let mut set = alloy_core::primitives::map::HashSet::<MyStruct>::default();
set.insert(Default::default());
let mut set = alloy_core::primitives::map::B256Map::<MyStruct>::default();
set.insert(
alloy_core::primitives::hex_literal::hex!(
"0x0000000000000000000000000000000000000000000000000000000000000000"
)
.into(),
Default::default(),
);
assert_eq!(set.len(), 1);
}

0 comments on commit c15f05e

Please sign in to comment.