-
Notifications
You must be signed in to change notification settings - Fork 352
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
Implement output for ContractSubmittableResult the same way it is in ContractExecResult #3349
Comments
There is a difference between exec and read - exec sends a transaction, transactions do not return values like a read call does. (The only communication a transaction does have is with events) |
Well, this basically means that we have emit events to know the reason why a transaction failed? Is there a better way to do that in ink? |
The general and only way a transaction can communicate with the outside world (providing info on success) is via events. For Substrate itself, error conditions are indicated with an Error enum that is returned via the ExtrinsicFailed event itself. If a failure is meant to emit an event, it would mean the transaction needs to succeed - event are not emitted on ExtrinsicFailed statuses. I'm no ink! expert (only understand how transactions actually do work), so it may be worth-while asking the team, they would be happy to help. |
I think I came across the same issue at patractlabs/redspot#78 . @vminkov would you mind keeping me posted if you are able to resolve this? |
@RoyTimes The error forwarding of ink! is not implemented and still under discussion. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
Currently calls with contract.query.method() return the output, but calls with contract.tx.method() do not and in pieces like this one:
it is not possible to extract the output from ContractSubmittableResult - its fields are
whereas ContractExecResult has:
The text was updated successfully, but these errors were encountered: