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

Conversions of Provider ID, Opcode and Auth type should not fail #111

Open
hug-dev opened this issue Jun 4, 2021 · 0 comments
Open

Conversions of Provider ID, Opcode and Auth type should not fail #111

hug-dev opened this issue Jun 4, 2021 · 0 comments
Labels
bug Something isn't working medium Effort label

Comments

@hug-dev
Copy link
Member

hug-dev commented Jun 4, 2021

Provider ID, opcode and auth type are represented in our contracts as unsigned integer. The interface converts the integer to the Rust native enumerations and return ProviderDoesNotExist, OpcodeDoesNotExist or AuthenticatorDoesNotExist if the integer can not be mapped to one of the variant.

I see two problems with that:

  1. ProviderID should maybe not be an enum but a new type over an integer instead.
  2. Opcode and AuthType should maybe contain an Unknown(u32) variant to represent the one that the interface does not yet know. That would also be good as these enums are not exhaustive (new opcodes/auth types will always be added).
@hug-dev hug-dev added bug Something isn't working medium Effort label labels Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working medium Effort label
Projects
None yet
Development

No branches or pull requests

1 participant