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

Refactor HandlerOutput and HandlerResult #184

Closed
plafer opened this issue Oct 17, 2022 · 2 comments
Closed

Refactor HandlerOutput and HandlerResult #184

plafer opened this issue Oct 17, 2022 · 2 comments
Labels
O: new-feature Objective: aims to add new feature

Comments

@plafer
Copy link
Contributor

plafer commented Oct 17, 2022

HandlerOutput and HandlerResult should be modeled roughly as:

struct HandlerResult<T> {
    // We want to return logs even if the processing fails
    logs: Vec<String>,
    result: Result<HandlerOutput<T>, Error>
}

struct HandlerOutput<T> {
    // previously `result`, which "collides" with Rust's `Result`
    value: T,
    events: Vec<IbcEvent>,
}

HandlerOutputBuilder would also be renamed to HandlerResultBuilder, and build a HandlerResult. with_result() could be split into with_value(T), and without_value() (to avoid the ugly with_result(()) when there's no result). Hopefully we could get rid of merge() and merge_output() as well.

@hu55a1n1 and @romac contributed to these ideas.

@plafer plafer added the O: new-feature Objective: aims to add new feature label Oct 17, 2022
@plafer
Copy link
Contributor Author

plafer commented Oct 17, 2022

Related: #23

@plafer
Copy link
Contributor Author

plafer commented Feb 21, 2023

This API is no longer used since #279. It will be completely removed after #442.

@plafer plafer closed this as completed Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: new-feature Objective: aims to add new feature
Projects
Status: Done
Development

No branches or pull requests

1 participant