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

refactor(hwi,wallet): enhance hardware wallet integration and testing #1492

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

pluveto
Copy link

@pluveto pluveto commented Jun 27, 2024

Overview

This PR introduces enhancements to the hardware wallet integration within the hwi crate and improves the testing utilities in the wallet crate.

Changes

  1. Enabling test-util Feature
    The bdk_wallet dependency in the hwi crate now includes the test-util feature, allowing the use of additional testing utilities provided by the bdk_wallet crate.
  2. refining TransactionSigner implementation
  3. Re-enabling and updating hardware wallet signer test
    The previously disabled hardware wallet signer test has been re-enabled and updated to use the test-util feature. This includes improvements to the test structure and error handling, ensuring robust and comprehensive testing.
  4. Move common test functions as test-util inside wallet crate
    A new test-util module has been added to the wallet crate to organize and provide utilities for testing. This promotes code reuse and maintainability across different tests.

@pluveto pluveto force-pushed the refactor/recover-testing branch 2 times, most recently from b8ea85a to 8f19aa3 Compare June 27, 2024 04:13
@evanlinjin
Copy link
Member

Thanks for this PR. I haven't had the opportunity to review this properly yet, however I am wondering if there is a particular reason why bdk_wallet is not a dev-dependency?

@evanlinjin
Copy link
Member

Also, can you please remove the merge commit and do a rebase instead? Thank you

@pluveto
Copy link
Author

pluveto commented Jul 12, 2024

OK.

insert_tx has been refactor in 324eeb3. I need to reorganize the code.

@pluveto
Copy link
Author

pluveto commented Jul 12, 2024

Reorganized and moved bdk_wallet with test-util feature flag into dev-dependency.

Ready for review. Please take a look.

@pluveto
Copy link
Author

pluveto commented Jul 12, 2024

It seems that the HWI emulator is disabled, which caused the HWI-related tests to fail.

Therefore, I have added it (add HWI emulator setup).

@pluveto
Copy link
Author

pluveto commented Jul 13, 2024

CI issue is fixed by specific OpenSSL config. 15d6d9a

@nondiremanuel nondiremanuel added the discussion There's still a discussion ongoing label Jul 16, 2024
@ValuedMammal
Copy link
Contributor

I appreciate what is accomplished in this PR. I'm somewhat ambivalent toward having this change. Main concern is bringing python dependency back to CI considering the age of this emulator software and that the nano s hasn't seen a firmware update since 2021 which amounts to more of a maintenance burden than I think is warranted. Other folks might have different opinions. In any case if you decide to continue work on this branch, we'd like if you also signed commits, although for the record I realized that policy isn't well documented.

@pluveto
Copy link
Author

pluveto commented Jul 17, 2024

Thank you for your feedback. I've updated the emulator model used for the firmware to a more recent version. Additionally, I've resubmitted the commits with signatures. Thanks!

@oleonardolima
Copy link
Contributor

Thanks for working on this! However, after #1561 the HWISigner and therefore the TransactionSigner implementation has moved to rust-hwi, so I guess we could close this PR (cc @notmandatory).

Feel free to open a PR in rust-hwi with your suggested enhancements, I also think we could reuse the approach of having a test util, exposing it through bdk_testenv, and use it there at rust-hwi for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion There's still a discussion ongoing tests
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

6 participants