Skip to content

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

Open
@hug-dev

Description

@hug-dev

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmediumEffort label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions