Skip to content

Accessing emitted events#92

Merged
pmikolajczyk41 merged 12 commits intomainfrom
events-example
Dec 11, 2023
Merged

Accessing emitted events#92
pmikolajczyk41 merged 12 commits intomainfrom
events-example

Conversation

@pmikolajczyk41
Copy link
Copy Markdown
Contributor

Implementing Treasury Proposal Roadmap - ink!DevHub 1.0 (view)

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.

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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
@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.

3 participants