substrate icon indicating copy to clipboard operation
substrate copied to clipboard

feat: renamed ensure_none to unsure_unsigned

Open gitofdeepanshu opened this issue 2 years ago • 8 comments

Fix #13279

Description

Deprecate ensure_none and introduced the alias name ensure_unsigned.

NOTE

Not a breaking change

gitofdeepanshu avatar Feb 02 '23 08:02 gitofdeepanshu

The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2343452

paritytech-cicd-pr avatar Feb 02 '23 08:02 paritytech-cicd-pr

The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2343451

paritytech-cicd-pr avatar Feb 02 '23 08:02 paritytech-cicd-pr

Please don't just break common API without notice. You need to kept ensure_none alias and mark it as #[deprecated].

Added 'ensure_none' alias as suggested by @xlc .

gitofdeepanshu avatar Feb 02 '23 09:02 gitofdeepanshu

btw is it just me or does it take 30 minutes for everyone to build?

gitofdeepanshu avatar Feb 02 '23 09:02 gitofdeepanshu

btw is it just me or does it take 30 minutes for everyone to build?

Building the whole thing can take a while without Sccache and fast hardware. Normally compiling a few singluar crates + CI checks works good. I often just do cargo c -p pallet-balances or whatever for small changes.

Please update the description to mention the alias and that this is not a breaking change.

ggwpez avatar Feb 02 '23 09:02 ggwpez

Please update the description to mention the alias and that this is not a breaking change.

Done. Although local CI checks are passing, Polkadot CI is failing. ensure_none still exists but Polkadot can't seem to find it.

gitofdeepanshu avatar Feb 03 '23 08:02 gitofdeepanshu

As a user of the new ensure_unsigned I may logically (wrongly) infer that ensure_unsigned is the opposite of ensure_signed. But it is not, since Root origin is not allowed by both of them.

While this is true, you could not assume that ensure_none is meaning "no one can call this". And also nothing bad would be happen if you use ensure_unsigned and it is called with Root.

I think the general direction is fine, but we should also rename None in the enum RawOrigin to Unsigned. There are also usages of none like here: https://github.com/paritytech/substrate/blob/f5e370da7f34622637a343f03420b4242b321891/frame/support/src/traits/dispatch.rs#L349-L350

So, if we do it, we should do it everywhere and use deprecated where possible.

bkchr avatar Feb 06 '23 10:02 bkchr

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 08 '23 15:03 stale[bot]

@gitofdeepanshu would you take this issue over?

juangirini avatar May 17 '23 09:05 juangirini