2

How can I create a custom origin that executes some arbitrary logic on any transaction? The use case here is some identity check that fails a transaction, if the check fails.

In addition, I want to execute some custom logic on transactions coming from any transactions in my runtime, not just from extrinsics in custom pallets that I maintain.

Is this possible to do using just custom origins?

I am aware of Signed Extensions and their ability to extend transactions. Is there a reason I should not use Signed Extensions for such a case?

1 Answer 1

5

If you wish to execute custom logic on all transactions in your system, then a SignedExtension is the way to go. It can be used to introduce both new data into your chain's transactions, as well as checks, prioritisation, payment, ordering and more.

Introducing a new Origin is not needed for this, nor could it be used to alter the effective logic of any pallets you are not authoring to recognise this new Origin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.