Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Confusing error message on duplicate dispatchable function #6379

@apopiak

Description

@apopiak

When adding a duplicate dispatchable in a pallet's decl_module the resulting error message is confusing:

error: Implicit conversion to privileged function has been removed. First parameter of dispatch should be marked `origin`. For root-matching dispatch, also add `ensure_root(origin)?`.
   --> pallets/template/src/lib.rs:63:1
    |
63  | / decl_module! {
64  | |     /// The module declaration.
65  | |     pub struct Module<T: Trait> for enum Call where origin: T::Origin {
66  | |         // Initializing errors
...   |
116 | |     }
117 | | }
    | |_^
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

Observed behavior: Error message complaining about implicit conversion to privileged function.

Expected behavior: Error message indicating that duplicate defintion of the same dispatchable is not allowed.

See reproduction here: #6378

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions