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 changes for Segwit BSQ implementation #5109

Merged

Commits on Apr 27, 2021

  1. Code cleanup: Simplify Optional stream processing

    Use flatMap(Optional::stream) instead of filter(..isPresent).map(..get)
    and avoid a redundantly nested Optional in OpReturnType.
    
    Also replace some unnecessary stream().forEach(..) invocations on lists
    in BtcWalletService, as forEach is already part of the List interface.
    stejbac committed Apr 27, 2021
    Configuration menu
    Copy the full SHA
    ce73fb8 View commit details
    Browse the repository at this point in the history
  2. Allow use of bech32 BSQ addresses

    Remove the restriction to base58 (P2SH & P2PKH) addresses when parsing,
    formatting & validating BSQ addresses, by replacing o.b.c.LegacyAddress
    with its superclass o.b.c.Address throughout. Also remove restriction to
    LegacyAddress in BsqTxListItem and BsqTransfer(Service|Model).
    
    The bech32 BSQ addresses follow the same format as the old base58 BSQ
    addresses, namely 'B' + <btc-address>.
    stejbac committed Apr 27, 2021
    Configuration menu
    Copy the full SHA
    3470429 View commit details
    Browse the repository at this point in the history
  3. Perform segwit BSQ wallet migration upon startup

    Uncomment & enable the m/44'/142'/1' native segwit BSQ account path and
    add code to migrate the user's BSQ wallet to segwit upon startup, along
    the same lines as the existing BTC wallet segwit migration logic. That
    is, set P2WPKH as the default output type, add a native segwit key chain
    (set to active) to the BSQ wallet and back up the old 'bisq_BSQ.wallet'
    file to 'pre_segwit_bisq_BSQ.wallet.backup'.
    
    Also filter out legacy addresses coming from the original keychain from
    BsqWalletService.get(Unused|Change)Address.
    stejbac committed Apr 27, 2021
    Configuration menu
    Copy the full SHA
    5f1e32a View commit details
    Browse the repository at this point in the history
  4. Factor out shared segwit keychain setup to WalletsManager

    Move consecutive maybeAddSegwitKeychain(..) calls for the BTC & BSQ
    wallets from BisqSetup to WalletsManager, as the latter class is used
    for operations which should be applied to both wallets and this moves
    the logic closer to the wallet domain.
    
    Also migrate a BSQ address validator in one of the test mock classes
    from Base58AddressValidator to BitcoinAddressValidator (missed earlier).
    stejbac committed Apr 27, 2021
    Configuration menu
    Copy the full SHA
    9760526 View commit details
    Browse the repository at this point in the history