Skip to content

Commit

Permalink
Use chain id integers as dictionary keys for merging logic instead of…
Browse files Browse the repository at this point in the history
… converting chain ids to strings.
  • Loading branch information
derekpierre committed Oct 12, 2023
1 parent 6efa87d commit 6096a2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deployment/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,20 @@ def merge_registries(
for e in read_registry(registry_1_filepath):
if e.name in deprecated_contracts:
continue
reg1[str(e.chain_id)][e.name] = e
reg1[e.chain_id][e.name] = e

for e in read_registry(registry_2_filepath):
if e.name in deprecated_contracts:
continue
reg2[str(e.chain_id)][e.name] = e
reg2[e.chain_id][e.name] = e

merged: List[RegistryEntry] = list()

# Iterate over all chains and unique contract names across both registries
all_chains = set(reg1) | set(reg2)
common_chains = set(reg1) & set(reg2)
for chain in all_chains:
reg1_chain_entries, reg2_chain_entries = reg1.get(str(chain), {}), reg2.get(str(chain), {})
reg1_chain_entries, reg2_chain_entries = reg1.get(chain, {}), reg2.get(chain, {})
if chain in common_chains:
# check for conflicting contracts
all_contracts = set(reg1_chain_entries) | set(reg2_chain_entries)
Expand Down

0 comments on commit 6096a2c

Please sign in to comment.