Skip to content

Commit

Permalink
chore(registry): Small Cleanup (#307)
Browse files Browse the repository at this point in the history
### Description

Small PR cleaning up the test utilities in `op-alloy-registry`
  • Loading branch information
refcell authored Nov 23, 2024
1 parent 364a3a9 commit fff9f55
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions crates/registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub mod superchain;
pub use superchain::Registry;

#[cfg(test)]
pub mod configs;
pub mod test_utils;

lazy_static::lazy_static! {
/// Private initializer that loads the superchain configurations.
Expand All @@ -37,13 +37,15 @@ lazy_static::lazy_static! {

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_hardcoded_rollup_configs() {
let test_cases = vec![
(10, crate::configs::OP_MAINNET_CONFIG),
(8453, crate::configs::BASE_MAINNET_CONFIG),
(11155420, crate::configs::OP_SEPOLIA_CONFIG),
(84532, crate::configs::BASE_SEPOLIA_CONFIG),
(10, test_utils::OP_MAINNET_CONFIG),
(8453, test_utils::BASE_MAINNET_CONFIG),
(11155420, test_utils::OP_SEPOLIA_CONFIG),
(84532, test_utils::BASE_SEPOLIA_CONFIG),
];

for (chain_id, expected) in test_cases {
Expand Down
2 changes: 1 addition & 1 deletion crates/registry/src/superchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ mod tests {
let superchains = Registry::from_chain_list();
assert_eq!(
*superchains.rollup_configs.get(&10).unwrap(),
crate::configs::OP_MAINNET_CONFIG
crate::test_utils::OP_MAINNET_CONFIG
);
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fff9f55

Please sign in to comment.