Open ggwpez opened 1 month ago
Hi @ggwpez would be great to have link references if possible, would like to take this on!
Maybe assigning me also?
Hi @ggwpez would be great to have link references if possible, would like to take this on!
Yea please go ahead. What else do you need references for? I would suggest to check out how the utility::batch
can be used and extrapolation from there.
The issue should contain all the info needed.
@ggwpez What might interrupt calls? https://github.com/paritytech/polkadot-sdk/blob/d1c115b6197bf6c45d5640594f0432e6c2781a4f/substrate/frame/utility/src/lib.rs#L215
Calls can return an error, in which case we want to call the else
(aka fallback) call.
Some internal discussions brought up the idea of making calls easier to compose, starting simple with an
if_else
call.The purpose of this call would be execute an error callback when the first call is not successful. Other names for this could be
unless
orotherwise
. Signature can look like this:This would allow users to not just compose calls on their success case (via
batch
), but also in the error case.The error is not accessible, and AFAIK that is also not easily implementable without using double-encoded partial calls.
Alternatively this can already be done via XCM, but nobody seems to know/do that, so having this alternative way without XCM can make the runtime easier to use.