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

Subset of Forest Maintenance Tasks (Part 2) #1571

Merged
merged 8 commits into from
Jun 29, 2022
Merged

Conversation

jdjaustin
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:
To be removed

  • Remove all use of Box<dyn Error> in favor of anyhow::Error

Reference issue to close (if applicable)

Closes corresponding task in #1536

Other information and links

N/A

@codecov
Copy link

codecov bot commented Jun 23, 2022

Codecov Report

Merging #1571 (a64753a) into main (20675e6) will decrease coverage by 5.39%.
The diff coverage is 18.18%.

@@            Coverage Diff             @@
##             main    #1571      +/-   ##
==========================================
- Coverage   39.89%   34.50%   -5.40%     
==========================================
  Files         236      207      -29     
  Lines       15902    23378    +7476     
==========================================
+ Hits         6344     8066    +1722     
- Misses       9558    15312    +5754     
Impacted Files Coverage Δ
blockchain/beacon/src/mock_beacon.rs 23.07% <0.00%> (+8.79%) ⬆️
blockchain/state_manager/src/utils.rs 0.00% <0.00%> (ø)
crypto/src/errors.rs 0.00% <0.00%> (ø)
node/forest_libp2p/src/behaviour.rs 0.00% <0.00%> (ø)
vm/actor_interface/src/adt/array.rs 0.00% <0.00%> (ø)
vm/actor_interface/src/builtin/market/mod.rs 0.00% <ø> (ø)
vm/actor_interface/src/builtin/miner/mod.rs 0.00% <0.00%> (ø)
vm/actor_interface/src/adt/map.rs 37.14% <20.00%> (+2.93%) ⬆️
blockchain/beacon/src/drand.rs 32.77% <30.00%> (+2.21%) ⬆️
types/networks/src/lib.rs 76.59% <100.00%> (+1.59%) ⬆️
... and 253 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20675e6...a64753a. Read the comment docs.

@jdjaustin
Copy link
Contributor Author

jdjaustin commented Jun 23, 2022

Many occurrences of Box<dyn Error> are aliased as Box<dyn StdError> and changing all these occurrences would probably best be handled under a separate PR, to keep PR sizes manageable. The final occurrences of Box<dyn Error> in map.rs are associated with functions that utilizeBox<dyn StdError>. Will capture this either under a seprate issue or by modifying issue #1536 .

@jdjaustin jdjaustin changed the title [WIP] Subset of Forest Maintenance Tasks (Part 2) Subset of Forest Maintenance Tasks (Part 2) Jun 23, 2022
@jdjaustin jdjaustin marked this pull request as ready for review June 23, 2022 18:45
blockchain/state_manager/src/utils.rs Outdated Show resolved Hide resolved
vm/message/src/signed_message.rs Outdated Show resolved Hide resolved
Copy link
Member

@LesnyRumcajs LesnyRumcajs left a comment

Choose a reason for hiding this comment

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

@lemmih is right, I'd extend it to all other places where you changed ? to unwrap. In general, if a method returns a Result, I don't expect it to panic. Please apply here the Principle of least astonishment for poor me. :)

@jdjaustin
Copy link
Contributor Author

What do you guys suggest instead of using unwrap here? I had to remove the ? due to compiler errors after changing Box<dyn Error> to anyhow::Error. If I leave out .unwrap(), the compiler gives me a warning about an unused Result.

@LesnyRumcajs
Copy link
Member

LesnyRumcajs commented Jun 27, 2022

What do you guys suggest instead of using unwrap here? I had to remove the ? due to compiler errors after changing Box<dyn Error> to anyhow::Error. If I leave out .unwrap(), the compiler gives me a warning about an unused Result.

What do you think about .map_err? Have a look at an example here

blockchain/beacon/src/drand.rs Outdated Show resolved Hide resolved
blockchain/beacon/src/drand.rs Outdated Show resolved Hide resolved
@lemmih lemmih merged commit c475fa5 into main Jun 29, 2022
@lemmih lemmih deleted the jdjaustin/forest-maint-v4 branch June 29, 2022 13:44
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.

4 participants