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:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
parent
f8c90b2a