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

Code overlap between TariAddress and EmojiId #6291

Open
AaronFeickert opened this issue Apr 19, 2024 · 0 comments
Open

Code overlap between TariAddress and EmojiId #6291

AaronFeickert opened this issue Apr 19, 2024 · 0 comments

Comments

@AaronFeickert
Copy link
Collaborator

There is a fair amount of duplication between TariAddress and EmojiId. Both represent a public key, but TariAddress additionally includes a network representation combined with the checksum. While the use cases are strictly different (an EmojiId need not represent a wallet address), the overlap has a bad code smell that suggests the abstractions might be a bit off.

One approach to this could be including the network byte handling in EmojiId in a generic way: when constructing an EmojiId, the caller can optionally include an extra byte to be combined with the checksum. This would allow for the existing functionality to be retained, while also supporting the requirements of TariAddress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant