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

[wallet] Improve address API #1402

Merged
merged 4 commits into from
Apr 20, 2024

Commits on Apr 20, 2024

  1. feat(wallet): Add new address methods

    Introduce a new API for getting addresses from the Wallet that
    reflects a similiar interface as the underlying indexer
    `KeychainTxOutIndex` in preparation for removing `AddressIndex` enum.
    
    Before this change, the only way to get an address was via the methods
    `try_get{_internal}_address` which required a `&mut` reference to the
    wallet, matching on the desired AddressIndex variant. This is too
    restrictive since for example peeking or listing unused addresses
    shouldn't change the state of the wallet. Hence we provide separate
    methods for each use case which makes for a more efficient API.
    ValuedMammal authored and evanlinjin committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    d3763e5 View commit details
    Browse the repository at this point in the history
  2. refactor(wallet)!: Remove method get_address

    As this is now made redundant by the newly added
    wallet address methods.
    ValuedMammal authored and evanlinjin committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    d878747 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a266b47 View commit details
    Browse the repository at this point in the history
  4. test(wallet): Test wallet addresses

    Adds test coverage for Wallet methods `reveal_addresses_to`,
    `mark_used`, and `unmark_used`
    ValuedMammal authored and evanlinjin committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    d39b319 View commit details
    Browse the repository at this point in the history