Skip to content

Conversation

@gui1117
Copy link
Contributor

@gui1117 gui1117 commented Mar 11, 2025

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.

@gui1117 gui1117 requested a review from a team as a code owner March 11, 2025 04:02
@gui1117 gui1117 added the R0-no-crate-publish-required The change does not require any crates to be re-published. label Mar 11, 2025
@gui1117 gui1117 force-pushed the gui-better-error-message branch from 99b7612 to d4d0ec5 Compare March 11, 2025 07:15
@gui1117
Copy link
Contributor Author

gui1117 commented Mar 11, 2025

/cmd update-ui

@paritytech paritytech deleted a comment from github-actions bot Mar 11, 2025
@paritytech paritytech deleted a comment from github-actions bot Mar 11, 2025
@github-actions
Copy link
Contributor

Command "update-ui" has started 🚀 See logs here

@github-actions
Copy link
Contributor

Command "update-ui" has finished ✅ See logs here

@gui1117 gui1117 added this pull request to the merge queue Mar 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 11, 2025
@gui1117 gui1117 enabled auto-merge March 12, 2025 02:09
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/13823133324
Failed job name: test-linux-stable

@gui1117 gui1117 disabled auto-merge March 13, 2025 08:11
@gui1117 gui1117 enabled auto-merge March 13, 2025 08:11
@gui1117 gui1117 added this pull request to the merge queue Mar 13, 2025
Merged via the queue into master with commit a71a701 Mar 13, 2025
237 of 243 checks passed
@gui1117 gui1117 deleted the gui-better-error-message branch March 13, 2025 09:28
ordian added a commit that referenced this pull request Mar 17, 2025
* origin: (325 commits)
  Add an extra_constant to pallet-treasury (#7918)
  Bump the ci_dependencies group across 1 directory with 4 updates (#7855)
  remove compromised action (#7934)
  Fixing token-economics dead link (#5302)
  [pallet-revive] Fix pallet-revive-fixtures build.rs (#7928)
  cumulus: fix pov exporter format (#7923)
  sp-api: Support `mut` in `impl_runtime_apis!` (#7924)
  Remove clones from block seal function (#7917)
  [pallet-revive] precompiles 2->9 (#7810)
  Use non-native token to benchmark xcm on asset hub (#7893)
  [CI] bump timeout wait for build in zombienet workflows. (#7871)
  taplo: split long array line to multiline array (#7905)
  [pallet-revive] fixture as dev dep (#7844)
  notifications/libp2p: Punish notification protocol misbehavior on outbound substreams (#7781)
  [Release|CI/CD] Update version of the cache action in the Publish docker ci (#7892)
  Remove `pallet::getter` usage from bridges/modules (#7120)
  [pallet-revive] Support blocktag in eth_getLogs RPC (#7879)
  Improve error message in benchmark macro (#7873)
  staking: add `manual_slash` extrinsic (#7805)
  Remove execute_with_origin implementation in the XCM executor (#7889)
  ...
alindima pushed a commit that referenced this pull request Apr 8, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R0-no-crate-publish-required The change does not require any crates to be re-published.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants