bugfix: couldn't edit networks due to wrong chain id field name#1512
Merged
bugfix: couldn't edit networks due to wrong chain id field name#1512
Conversation
Contributor
There was a problem hiding this comment.
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 toid()in theNetworktype - Added new
dedup_id()helper method toNetwork - Updated all references from
dedup_chain_idparameter/variable names toidthroughout Rust codebase - Corrected the GUI form field name from
dedup_chain_id.chain_idtoid.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.
Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.