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

Remove HasCompact from BaseArithmetic #5004

Open
lemunozm opened this issue Jul 11, 2024 · 1 comment
Open

Remove HasCompact from BaseArithmetic #5004

lemunozm opened this issue Jul 11, 2024 · 1 comment
Labels
I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@lemunozm
Copy link

Hi, for some use cases, it would be appropriate to implement BaseArithmetic for types other than basic Rust number types.

Although all traits from BaseArithmetic are implementable, the HasCompact is not, because it is automatically implemented in parity_scale_codec for T, but it's impossible from an external crate of parity_scale_codec to fulfill the requirements to get the auto implementation of HasCompact for your type.

This basically means that BaseArithmetic is a "sealed" trait where no more types can implement it.

My question is, is HasCompact really a requirement for BaseArithmetic? why do that restriction? If it's not a requirement, can it then be removed from BaseArithmetic?

@github-actions github-actions bot added the I10-unconfirmed Issue might be valid, but it's not yet known. label Jul 11, 2024
@lemunozm
Copy link
Author

lemunozm commented Jul 11, 2024

Related issue about implementing HasCompact: paritytech/parity-scale-codec#613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

1 participant