Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve append_extrinsic to return a DispatchResult #67

Open
lemunozm opened this issue Oct 11, 2023 · 4 comments
Open

Improve append_extrinsic to return a DispatchResult #67

lemunozm opened this issue Oct 11, 2023 · 4 comments
Labels
I8-enhancement An additional feature.

Comments

@lemunozm
Copy link
Contributor

lemunozm commented Oct 11, 2023

Currently if an extrinsic fails, it returns a () as error, would be awesome to return a DispatchResult instead (not sure is it feasible)

@lemunozm lemunozm added the I8-enhancement An additional feature. label Oct 11, 2023
@lemunozm
Copy link
Contributor Author

@cdamian is your last fudge adventure did you have a chance to know if this is feasible?

@cdamian
Copy link
Contributor

cdamian commented Oct 25, 2023

@lemunozm we're already returning an error now - https://github.com/centrifuge/fudge/blob/master/core/src/builder/core.rs#L645

Not sure if a DispatchResult would be possible though, we have to rely on the error that was returned by the pool when submitting the transaction.

@lemunozm
Copy link
Contributor Author

Cool! I just see that the error is also returned in the macro expansion. More cool!

@lemunozm
Copy link
Contributor Author

After searching about this, it seems not possible. Nothing except a string of the error is propagated (https://github.com/paritytech/polkadot-sdk/blob/master/substrate/utils/frame/rpc/system/src/lib.rs#L164). The error could later be read in the event, but you need to evolve the chain at least one block to get it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I8-enhancement An additional feature.
Projects
None yet
Development

No branches or pull requests

2 participants