Skip to content
Snippets Groups Projects
Unverified Commit a71a701c authored by thiolliere's avatar thiolliere Committed by GitHub
Browse files

Improve error message in benchmark macro (#7873)


giving the wrong origin in `extrinsic_call` would result in:
```
   |
43 | #[benchmarks]
   | ^^^^^^^^^^^^^
   | |
   | expected associated type, found `Result<RawOrigin<...>, ...>`
   | arguments to this function are incorrect
   |
   = note: expected associated type `<T as frame_system::Config>::RuntimeOrigin`
                         found enum `Result<RawOrigin<<T as frame_system::Config>::AccountId>, <T as frame_system::Config>::RuntimeOrigin>`
note: method defined here
  --> $WORKSPACE/substrate/frame/support/src/traits/dispatch.rs
   |
   |     fn dispatch_bypass_filter(self, origin: Self::RuntimeOrigin) -> DispatchResultWithPostInfo;
   |        ^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the attribute macro `benchmarks` (in Nightly builds, run with -Z macro-backtrace for more info)
```

Now it results in an error message with good span.

---------

Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
parent f8c90b2a
No related merge requests found
Pipeline #518836 waiting for manual action with stages
in 20 minutes and 57 seconds