Skip to content

Comments

bugfix: couldn't edit networks due to wrong chain id field name#1512

Merged
naps62 merged 2 commits intomainfrom
fix-network-edit
Dec 4, 2025
Merged

bugfix: couldn't edit networks due to wrong chain id field name#1512
naps62 merged 2 commits intomainfrom
fix-network-edit

Conversation

@naps62
Copy link
Member

@naps62 naps62 commented Dec 4, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 4, 2025 14:57
@naps62 naps62 added the B-bugfix Something is working again label Dec 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where network editing failed due to an incorrect field name reference in the GUI form. The core issue was that the form was using dedup_chain_id.chain_id instead of id.chain_id to reference the network's chain ID field.

The fix involved a comprehensive refactoring to improve naming consistency across the codebase:

  • Renamed the dedup_chain_id() method to id() in the Network type
  • Added new dedup_id() helper method to Network
  • Updated all references from dedup_chain_id parameter/variable names to id throughout Rust codebase
  • Corrected the GUI form field name from dedup_chain_id.chain_id to id.chain_id

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
gui/src/routes/home/_l/networks/_l/$name.edit.tsx Fixed form field name from dedup_chain_id.chain_id to id.chain_id to match Network type structure; added debug console.log
crates/types/src/network/mod.rs Renamed dedup_chain_id() method to id() and added new dedup_id() helper method
crates/sync/anvil/src/tracker/consumer.rs Renamed dedup_chain_id field/parameter to id for consistency; simplified trace logging
crates/rpc/src/methods/chain_update.rs Updated method calls from dedup_chain_id() to id() and set_current_by_dedup_chain_id() to set_current_by_id()
crates/networks/src/migrations.rs Updated test assertion to use id() instead of dedup_chain_id()
crates/networks/src/init.rs Renamed parameter from dedup_chain_id to id and updated method call to set_current_by_id()
crates/networks/src/commands.rs Updated method call from get_by_dedup_chain_id() to get_by_id()
crates/networks/src/actor/mod.rs Renamed methods and parameters from dedup_chain_id to id for consistency
crates/networks/src/actor/ext.rs Updated trait methods and message types from dedup_chain_id naming to id
crates/db/src/queries/events.rs Renamed parameter from dedup_chain_id to id in save_events() function
crates/db/src/queries/contracts.rs Renamed parameter from dedup_chain_id to id in insert_contract_with_abi() function
crates/db/src/lib.rs Renamed parameter from dedup_chain_id to id in truncate_events() function
crates/db/src/init.rs Updated method call from dedup_chain_id().dedup_id() to dedup_id()
crates/connections/src/init.rs Updated method call from dedup_chain_id() to id()
crates/connections/src/ctx.rs Renamed variable from dedup_chain_id to id in pattern matching
crates/connections/src/commands.rs Renamed variable from dedup_chain_id to id throughout the function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@naps62 naps62 enabled auto-merge (squash) December 4, 2025 15:05
@naps62 naps62 merged commit 4e049f9 into main Dec 4, 2025
7 checks passed
@naps62 naps62 deleted the fix-network-edit branch December 4, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-bugfix Something is working again

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant