Conversation
- Add type column to AddressRecord with migration - Set .contact type for local contacts in ContactService - Set .validator type for validators in StakeService - Update AddressStore to persist address type - Update mocks and previews with type parameter
Summary of ChangesHello @DRadmir, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience by introducing visual cues for different recipient types within the application. By extending core data models and implementing a database migration, the system can now store and display specific icons for domain names (like ENS) and contacts, making it easier for users to identify their transaction recipients at a glance. The changes also include minor refactorings to protocol conformances for improved data handling. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request introduces functionality to display icons in the recipient row based on the recipient's type (domain or contact). This involves adding new type properties to AddressName and Recipient structs, updating their initializers, and modifying various view models and store operations to handle these new types. A new RecipientType enum is introduced, and the AddressType enum is extended with a .contact case. Additionally, a new ENS icon asset is added. The changes are well-contained and address the stated objective of adding icons to the recipient row.
| case .ens, .basenames: AssetImage.image(Images.NameResolve.ens) | ||
| case .ud, .sns, .spaceid, .lens, .ton, .tree, .eths, .did, .suins, .aptos, .injective, .icns, .hyperliquid, .allDomains: nil | ||
| } |
There was a problem hiding this comment.
The switch provider statement for .domain cases has a default nil return for many cases. If new NameProvider cases are added in the future, this switch statement might not cover them, leading to a missing icon. Consider adding a default: nil case to explicitly handle all other NameProvider types, or ensure all cases are explicitly listed if an icon is expected for each.
| migrator.registerMigration("Add type to \(AddressRecord.databaseTableName)") { db in | ||
| try? db.alter(table: AddressRecord.databaseTableName) { | ||
| $0.add(column: AddressRecord.Columns.type.name, .text) | ||
| } |
There was a problem hiding this comment.
The migration to add the type column to AddressRecord is correctly implemented. However, it uses try? db.alter, which means if the alteration fails, it will silently ignore the error. For database migrations, it's generally better to let errors propagate to ensure data integrity, especially for schema changes. Consider removing the ? to make it try db.alter.
Close: #1725