Open twhiteheadzm opened 3 years ago
Hi @twhiteheadzm thanks for making this issue. We certainly need how-to content on origins. Ideally they would reference the Knowledgebase article on Origins and link to some examples. Those that come to mind most prominently are use cases for governance in the Treasury and Collective pallets. But it would be nice to see some other examples !
If you feel like contributing, make a draft PR of an outline following the this template for one or more of the guides you'd like to see and I'll jump in to polish things up. 😃
The scenario: A pallet has a custom origin used with proposals similar to the collective pallet. Examples of: How to use that custom origin to set rules for extrinsics within the same pallet. How to use that custom origin to set a rule for all extrinsics in another pallet. (eg require a certain threshold of votes) How to use that custom origin to set a rule to be checked within each extrinsic of another pallet ie check the number of votes within the extrinsic based on logic.
I figured out the above eventually, but it took a while to understand how it was done. It would have been helpful to have a basic description of how it works and what is going on behind the scenes in the macros. I am not yet a Rust expert and the macros make it even harder to understand.