1

I'm writing a hook for a pallet, this hook pop Call out of storage and execute them on behalf of a specified user through call.dispatch(origin).

My question is:
Will dispatch will make origin pay the fees associated with this Call?
If yes is that true both in a the context of a hook and in the context of a regular user triggered call causing a call.dispatch to be issued? Who pay for what if the origin of the dispatched call is different from the origin of the original call?

1 Answer 1

3

Will dispatch will make origin pay the fees associated with this Call?

No, only the signer of a transaction will pay fees for it (although there are some PRs in Substrate to make that a bit more flexible, so this answer may change).

When executing a transaction, it goes through a few phases: pre-dispatch, dispatch, and post-dispatch. The fee for the given length/weight is taken in the pre-dispatch phase, and it won't even dispatch if the account cannot pay the fees. Then dispatch happens, and any fee refund/change, if there is some, would happen in post-dispatch. So, dispatch assumes that whatever conditions for dispatch (e.g. a fee, or scheduling by referendum) have already taken place.

5

Your Answer

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

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