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

Accessing emitted events #92

Merged
merged 12 commits into from
Dec 11, 2023
Merged

Accessing emitted events #92

merged 12 commits into from
Dec 11, 2023

Conversation

pmikolajczyk41
Copy link
Member

Implementing https://github.com/orgs/inkdevhub/projects/2/views/1?pane=issue&itemId=34267897

In order to simplify a bit Session object, we introduce Record type that collects all the results, returns and events that have been produced by contract interactions during a session.


let ret = match &result.result {
Ok(exec_result) if exec_result.result.did_revert() => {
Err(SessionError::DeploymentReverted)
}
Ok(exec_result) => {
let address = exec_result.account_id.clone();
self.deploy_returns.push(address.clone());
self.record.push_deploy_return(address.clone());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't address a Copy type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, we are relying on the trait bounds from frame_system which do not impose Copy

Copy link
Collaborator

@deuszx deuszx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code around event/result decoding is so similar to what there is in the ink-wrapper <-> drink! integration that it makes me wonder whether we're not taking it a bit too far on either side (drink! or ink-wrapper) and start duplicating the work.

@pmikolajczyk41 pmikolajczyk41 merged commit fab9dc7 into main Dec 11, 2023
2 checks passed
@pmikolajczyk41 pmikolajczyk41 deleted the events-example branch December 11, 2023 12:38
@pmikolajczyk41 pmikolajczyk41 mentioned this pull request Mar 6, 2024
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

Successfully merging this pull request may close these issues.

None yet

3 participants