feat(core): move DeepestErrorFinder into dedicated deepest_error.rs - #398
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The failing Rust Checks / Check formatting step is not caused by this PR. The job never even reaches the compile/test steps because it fails at formatting first, but for reference, Happy to rebase once |
|
@JuliobaCR thanks, yes i will resolve the formatting issues on my end, i have reviewed your PR, it is okay. Thanks. |
|
@JuliobaCR fix conflicts in your pr, main branch issues have been resolved |
|
@JuliobaCR i am expecting your changes |
Issue Toolbox-Lab#393 asks for DeepestErrorFinder to live in its own file (crates/core/src/decode/deepest_error.rs) rather than inside chain_analyzer.rs where it was implemented for Toolbox-Lab#378. Extracts the struct, finder, and tests into the dedicated module, re-exporting via decode::mod, and fixes an off-by-one in the reported call depth: the failure depth was read from the post-push stack length instead of the depth of the frame that was actually active when the failure fired, which under-reported the true depth by one on every nested (2+ level) failure. Adds coverage for 4-level nesting and recursive re-entry.
854c37c to
7bf2e0a
Compare
|
@codeZe-us Conflicts resolved — rebased onto the updated
Verified locally (matching the CI steps):
PR now shows as mergeable/clean against |
|
@JuliobaCR Thanks, PR reviewed and merged |
Summary
Closes #393.
DeepestErrorFinderwas previously implemented as part of #378 insidechain_analyzer.rs. This PR moves it into its own dedicated module,crates/core/src/decode/deepest_error.rs, matching the file location specified in #393.DeepestError/DeepestErrorFinder/find_deepest_errorextracted intocrates/core/src/decode/deepest_error.rs.is_failure,topic_to_string,hash_to_strkey,StackFrame) madepub(crate)inchain_analyzer.rsso the two analyzers reuse identical logic instead of duplicating it.decode::mod(DeepestError,DeepestErrorFinder,find_deepest_error).Test plan
cargo test -p grat-core --lib -- decode::— 212 passed, 0 failed (includes 20deepest_errortests, allchain_analyzer/walkertests unaffected).Note:
maincurrently fails to build (cargo check -p grat-core) due to ~15 pre-existing, unrelated errors inmulti_op_decoder.rsandreport.rs(likely from an incomplete merge of #390). Those are out of scope here; to validate this change I temporarily patched around them in a disposable local clone only, not in this branch.