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

fix: missing enum variant for StakingOperation. #805

Merged
merged 1 commit into from
Mar 16, 2024

Commits on Mar 16, 2024

  1. fix: missing enum variant for StakingOperation.

    Problem
    
    The IPC API module was missing enum variant StakingOperation#SetFederatedPower.
    The fallback branch of the u8 to enum ended up representing unrecognized ABI
    values as SetMetadata operations. Consequently, SetFederatedPower commands were being
    wrongly translated and applied in the subnet gateway as SetMetadata commands.
    
    Solution
    
    Add the missing enum variant and make the conversion typesafe by using try_from.
    To avoid being pedantic, use num_enum macros. This create was anyway part of the build
    graph already, so we might as well use it.
    
    Credits
    
    Shoutout to @mikevoronov and @folex from Fluence Labs for reporting this!
    raulk committed Mar 16, 2024
    Configuration menu
    Copy the full SHA
    4bc41ce View commit details
    Browse the repository at this point in the history