Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor public addresses field in Person #63

Open
Airiinnn opened this issue Oct 16, 2024 · 0 comments
Open

Refactor public addresses field in Person #63

Airiinnn opened this issue Oct 16, 2024 · 0 comments
Labels
severity.Low A flaw that is unlikely to affect normal operations of the product type.Bug A bug

Comments

@Airiinnn
Copy link

Airiinnn commented Oct 16, 2024

The Person class currently utilizes a field defined as Map<Network, Set<PublicAddress>> to store public addresses. This implementation presents a significant risk of contamination, where the key representing a specific network (e.g., "BTC") may inadvertently allow values of a different network type (e.g., EthAddress). Since the type PublicAddress does not enforce type safety, this can lead to data integrity issues and make it challenging to manage the addresses appropriately.

Proposed solutions:

  1. Refactor the data structure (preferred)
  2. Add checks and tests to ensure this does not happen
@Airiinnn Airiinnn added type.Bug A bug severity.Medium A flaw that causes occasional inconvenience to some users, but they can continue to use the product severity.Low A flaw that is unlikely to affect normal operations of the product and removed severity.Medium A flaw that causes occasional inconvenience to some users, but they can continue to use the product labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity.Low A flaw that is unlikely to affect normal operations of the product type.Bug A bug
Projects
None yet
Development

No branches or pull requests

1 participant