-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add with_pays_fee for conversion to DispatchErrorWithPostInfo
#14470
base: master
Are you sure you want to change the base?
Conversation
|
User @bragov4ik, please sign the CLA here. |
|
Also I wanted to implement One of the ways I see to fix it is to |
|
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. |
|
Not sure why the CI doesn't pass with (lack of feature in |
| post_info: PostDispatchInfo { actual_weight: None, pays_fee }, | ||
| error: self.into(), | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like to me that we really should add a new function called with_post_info, so that callers can freely decide whether or not they want to use the default or modify any of the fields.
These methods should also exist in PostDispatchInfo rather than here as well, as it's not clear that the function actually returns a DispatchErrorWtihPostInfo after calling it.
It seems like the Polkadot companion is off, I will re-run the job. |
Description
Extend
WithPostDispatchInfoto allow easier specification ofpays_feewhen converting toDispatchErrorWithPostInfo.At the time of PR that added
with_weight(#5458),pays_feefield was not present, so it makes sense to add add such function.For example, instead of
one can write
My motivation in making this change is inconvenience when working with errors returned from other functions. In particular, I had the following case:
and this should be cleaner and easier to read: