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

Return the result of execute_operation as an event. #3308

Open
MathieuDutSik opened this issue Feb 12, 2025 · 0 comments
Open

Return the result of execute_operation as an event. #3308

MathieuDutSik opened this issue Feb 12, 2025 · 0 comments

Comments

@MathieuDutSik
Copy link
Contributor

The running of the execute_operation in the Linera smart contract is returning a typed response Self::Response. Then this answer is serialized as a Vec<u8>.

That Vec<u8> is then dropped in runtime.rs at the following line:

                code.execute_operation(context, operation).map(|_| ())

It is easy to avoid the dropping of this result. But the question is how to access it. In Ethereum, when a transaction is submitted with eth_sendRawTransaction, the user receives a transaction_hash. That transaction hash can then access to the result of the operation by doing eth_getTransactionReceipt. In Ethereum, if one is interested in getting the result without the result being committed then we can use more directly eth_call.

But Linera is not like Ethereum. What we could do is to redirect the result of operation to events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant