-
Notifications
You must be signed in to change notification settings - Fork 66
chore: typos, bindings, helpers #833
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughChanges include minor documentation fixes, removal of a crate-level lint allowance, addition of a wallet-aware BitcoinClient constructor (duplicated in the patch), and refactoring EsploraClient network detection to use the genesis block hash with new unit tests. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant EsploraClient
participant EsploraAPI
Note over Caller,EsploraClient: New flow — genesis-hash network detection
Caller->>EsploraClient: get_bitcoin_network()
EsploraClient->>EsploraAPI: GET /block/0/hash
EsploraAPI-->>EsploraClient: genesis_hash
EsploraClient->>EsploraClient: ChainHash::from_genesis_block_hash(genesis_hash)
EsploraClient->>EsploraClient: Network::try_from(chain_hash)
EsploraClient-->>Caller: Network
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)crates/utils/src/esplora_client.rs (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
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 |
Summary of ChangesHello @gregdhill, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on a series of small but impactful improvements across the codebase. It addresses minor textual errors in comments and documentation, refines Rust code generation attributes, and enhances the utility clients. A key improvement is the more robust Bitcoin network detection logic in the Esplora client, ensuring greater accuracy and reliability when interacting with different Bitcoin networks. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces several small but useful changes, including typo corrections, code cleanup in bindings, and a new helper function for the Bitcoin client. The most significant improvement is in esplora_client.rs, where network detection is now more robustly implemented by checking the genesis block hash. While this is a great change, the accompanying new test has a flaw: it doesn't actually assert the correctness of the returned network. I've left a comment with a suggestion to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
contracts/src/swap/Marketplace.sol(1 hunks)crates/bindings/src/lib.rs(1 hunks)crates/utils/src/bitcoin_client.rs(1 hunks)crates/utils/src/esplora_client.rs(3 hunks)deploy-all.md(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
crates/utils/src/esplora_client.rs (1)
crates/utils/src/mempool_client.rs (1)
new(28-41)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (6)
contracts/src/swap/Marketplace.sol (1)
11-11: LGTM! Comment typo corrected.The comment has been properly corrected from "cant have struct as key, nor tupple" to "can't have struct as key, nor tuple".
deploy-all.md (1)
40-40: LGTM! Heading spelling corrected.The section heading has been corrected from "Miscelaneous" to "Miscellaneous".
crates/utils/src/esplora_client.rs (2)
2-3: LGTM! Imports added to support genesis-hash-based network detection.The additions of
consensusandconstants::ChainHashare necessary for the refactoredget_bitcoin_networkmethod.
259-261: Excellent refactor! Genesis-hash-based network detection is more robust.The new implementation derives the network from the genesis block hash rather than URL patterns, which is more reliable and canonical. The logic is clean and leverages the standard
ChainHash::from_genesis_block_hashconversion.crates/utils/src/bitcoin_client.rs (1)
262-270: LGTM! Wallet-specific constructor is well-implemented.The
new_with_walletconstructor correctly builds a wallet-scoped RPC URL and delegates to the existingnewmethod. Verification confirms no duplicate definitions exist in the file—only one definition at line 262.crates/bindings/src/lib.rs (1)
1-1: Removingdead_codefrom lint allowance is safe.Verification confirmed no dead code warnings are triggered in the bindings crate. The change is approved.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Documentation
Chores