Skip to content

Commit

Permalink
feat: basic_toml
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Sep 2, 2024
1 parent d3508b2 commit 5bf55fc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 58 deletions.
63 changes: 10 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ alloy-consensus = { version = "0.3", default-features = false }
alloy-eips = { version = "0.3", default-features = false }

# Serialization
toml = { version = "0.8.14" }
basic-toml = "0.1.9"
# toml = { version = "0.8.14", default-features = false }
serde_repr = "0.1"
serde = { version = "1.0.203", default-features = false, features = ["derive", "alloc"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ superchain-primitives = { workspace = true, features = ["serde"] }

# Serialization
serde.workspace = true
toml.workspace = true
basic-toml.workspace = true

[dev-dependencies]
alloy-primitives.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/registry/src/chain_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub mod tests {
#[test]
fn read_chain_list_file() {
let chain_list = include_str!("../etc/chainList.toml");
let chains: ChainList = toml::from_str(chain_list).unwrap();
let chains: ChainList = basic_toml::from_str(chain_list).unwrap();
let base_chain = chains.chains.iter().find(|c| c.name == "Base").unwrap();
assert_eq!(base_chain.chain_id, 8453);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/registry/src/superchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ impl Registry {
/// Read the chain list.
pub fn read_chain_list() -> ChainList {
let chain_list = include_str!("../etc/chainList.toml");
toml::from_str(chain_list).expect("Failed to read chain list")
basic_toml::from_str(chain_list).expect("Failed to read chain list")
}

/// Read superchain configs.
pub fn read_superchain_configs() -> Superchains {
let superchain_configs = include_str!("../etc/configs.toml");
toml::from_str(superchain_configs).expect("Failed to read superchain configs")
basic_toml::from_str(superchain_configs).expect("Failed to read superchain configs")
}

/// Initialize the superchain configurations from the chain list.
Expand Down

0 comments on commit 5bf55fc

Please sign in to comment.