Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 43 additions & 85 deletions src/Cargo.lock

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

2 changes: 1 addition & 1 deletion src/chain_parsers/visualsign-ethereum/src/abi_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ mod tests {

const TEST_ADDRESS: &str = "0xdAC17F958D2ee523a2206206994597C13D831ec7";

fn make_abi_mappings(entries: Vec<(&str, Abi)>) -> std::collections::HashMap<String, Abi> {
fn make_abi_mappings(entries: Vec<(&str, Abi)>) -> std::collections::BTreeMap<String, Abi> {
entries
.into_iter()
.map(|(addr, abi)| (addr.to_string(), abi))
Expand Down
10 changes: 5 additions & 5 deletions src/chain_parsers/visualsign-ethereum/src/abi_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! - Performance: No file I/O or JSON parsing overhead
//! - Determinism: Same binary always uses same ABIs

use std::collections::HashMap;
use std::collections::BTreeMap;
use std::sync::Arc;

use alloy_json_abi::JsonAbi;
Expand All @@ -35,17 +35,17 @@ pub type ChainId = u64;
#[derive(Clone)]
pub struct AbiRegistry {
/// Maps ABI name -> parsed JsonAbi
abis: Arc<HashMap<String, Arc<JsonAbi>>>,
abis: Arc<BTreeMap<String, Arc<JsonAbi>>>,
/// Maps (chain_id, contract_address) -> ABI name
address_mappings: Arc<HashMap<(ChainId, Address), String>>,
address_mappings: Arc<BTreeMap<(ChainId, Address), String>>,
}

impl AbiRegistry {
/// Creates a new empty ABI registry
pub fn new() -> Self {
Self {
abis: Arc::new(HashMap::new()),
address_mappings: Arc::new(HashMap::new()),
abis: Arc::new(BTreeMap::new()),
address_mappings: Arc::new(BTreeMap::new()),
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/chain_parsers/visualsign-ethereum/src/networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,17 +497,17 @@ mod tests {

#[test]
fn test_constants_are_unique() {
let mut seen_ids = std::collections::HashSet::new();
let mut seen_ids = std::collections::BTreeSet::new();
for &(chain_id, _, _, _) in ALL_NETWORKS {
assert!(seen_ids.insert(chain_id));
}

let mut seen_names = std::collections::HashSet::new();
let mut seen_names = std::collections::BTreeSet::new();
for &(_, network_id, _, _) in ALL_NETWORKS {
assert!(seen_names.insert(network_id));
}

let mut seen_displays = std::collections::HashSet::new();
let mut seen_displays = std::collections::BTreeSet::new();
for &(_, _, display, _) in ALL_NETWORKS {
assert!(seen_displays.insert(display));
}
Expand Down
Loading
Loading