fix(provider): add P2TR address matching to key verification#86
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: This PR modifies cryptographic key verification logic by adding P2TR address matching, which requires human domain knowledge to ensure the derivation and comparison are correct.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/provider.rs`:
- Around line 442-443: The test coverage misses the P2TR branch: update tests to
assert the address_type is "p2tr" or add a new test that uses a known Taproot
puzzle/address; specifically modify or extend test_verify_key_match (or add a
new test) to provide a puzzle/address that maps to derived.p2tr and then assert
the function returns Some("p2tr") (or that address_type == "p2tr"), ensuring the
p2tr branch in provider.rs (the derived.p2tr == addr check) is executed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5956631d-8600-4e28-8892-0058167fc73a
📒 Files selected for processing (1)
src/provider.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Order imports as: external crates → std → blank line →super::→ blank line →crate::
Prefer?operator over.unwrap()in new code
UsePascalCasefor types and structs
Usesnake_casefor function and method names
UseSCREAMING_SNAKE_CASEfor constants
Usesnake_casefor file and module names
Files:
src/provider.rs
src/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.rs: Useindicatif::ProgressBarfor long-running operations
Place inline tests in#[cfg(test)] mod testsat the end of each file, using standardassert!andassert_eq!macros
Usetempfilecrate for file I/O tests
Files:
src/provider.rs
🧠 Learnings (1)
📚 Learning: 2026-03-13T13:20:58.369Z
Learnt from: oritwoen
Repo: oritwoen/vuke PR: 76
File: src/source/wordlist.rs:134-143
Timestamp: 2026-03-13T13:20:58.369Z
Learning: Do not flag .ok() calls on output.hit() / output.key() inside Rayon par_chunks().for_each() closures in Rust files (e.g., src/source/wordlist.rs) as bugs. Rayon for_each requires FnMut() -> (), which cannot propagate Result with ?. This is a known limitation discussed in issue `#77`. Treat these .ok() usages in this pattern as intentional and not regressions; focus review on actual logic or error handling outside this specific closure pattern.
Applied to files:
src/provider.rs
The `verify_key_boha` function checks P2PKH compressed, P2PKH uncompressed, and P2WPKH addresses against puzzle targets, but skips P2TR. If a puzzle uses a Taproot address, `vuke analyze --verify` won't match it even with the correct key.