Skip to content

Conversation

@jhheider
Copy link

more DRY

@jhheider jhheider requested a review from mxcl June 10, 2025 20:56
@jhheider jhheider requested a review from Copilot June 10, 2025 21:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors repeated keypair-loading logic into a single helper and updates various commands to use it, making the code more DRY.

  • Introduces get_keypair to centralize config loading and KeyData instantiation
  • Updates print_public_key, get_fingerprint, verify_commit, and sign_from_hex to call get_keypair
  • Removes duplicated config/keychain/secret-handling code from multiple functions
Comments suppressed due to low confidence (2)

bpb/src/main.rs:108

  • Add a doc comment above get_keypair to explain its purpose (loading config, retrieving the secret, and constructing a KeyData).
fn get_keypair() -> Result<KeyData, Error> {

bpb/src/main.rs:108

  • Consider adding unit tests for get_keypair to cover both successful key loading and error scenarios (e.g., missing keychain item or invalid hex).
fn get_keypair() -> Result<KeyData, Error> {

Base automatically changed from sign-hex-strings to main June 11, 2025 17:21
@mxcl mxcl merged commit 02499fb into main Jun 11, 2025
5 checks passed
@mxcl mxcl deleted the more-DRY branch June 11, 2025 17:21
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.

3 participants