URI: 
       ttransaction: put full derivation paths into PSBT by default - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit c81551299ef470d8580b56c316be242a0b810d7c
   DIR parent c3c64a37c26f965c89479923f3fc5f3ae2bf24c2
  HTML Author: SomberNight <somber.night@protonmail.com>
       Date:   Thu, 10 Dec 2020 17:36:02 +0100
       
       ttransaction: put full derivation paths into PSBT by default
       
       There are three export options for exporting a PSBT.
       The default option previously only put derivation path suffixes for pubkeys
       (paths relative to the intermediate xpub), now it puts the full path
       (if is known by the keystore).
       
       The "export for hardware device; include xpubs" option works same as before:
       it puts both full paths and also global xpubs into the PSBT.
       Hence the difference between the default option and the "include xpubs" option
       is now only that the latter puts global xpubs into the PSBT.
       
       This change is largely made for user-convenient in mind.
       Now exporting a PSBT should be less error-prone: particularly for the
       single-signer coldcard with sdcard usage, the default option will now work.
       
       closes #5969
       related #5955
       
       Diffstat:
         M electrum/gui/qt/transaction_dialog… |       2 +-
         M electrum/keystore.py                |      24 ++++++++++++++++++------
         M electrum/tests/test_wallet_vertica… |      44 ++++++++++++++++----------------
         M electrum/transaction.py             |      15 +++++++--------
         M electrum/wallet.py                  |      18 +++++++++---------
       
       5 files changed, 57 insertions(+), 46 deletions(-)
       ---
   DIR diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py
       t@@ -270,7 +270,7 @@ class BaseTxDialog(QDialog, MessageBoxMixin):
                if not isinstance(self.tx, PartialTransaction):
                    raise Exception("Can only export partial transactions for hardware device.")
                tx = copy.deepcopy(self.tx)
       -        tx.add_info_from_wallet(self.wallet, include_xpubs_and_full_paths=True)
       +        tx.add_info_from_wallet(self.wallet, include_xpubs=True)
                # log warning if PSBT_*_BIP32_DERIVATION fields cannot be filled with full path due to missing info
                from electrum.keystore import Xpub
                def is_ks_missing_info(ks):
   DIR diff --git a/electrum/keystore.py b/electrum/keystore.py
       t@@ -349,8 +349,12 @@ class MasterPublicKeyMixin(ABC):
                pass
        
            @abstractmethod
       -    def get_fp_and_derivation_to_be_used_in_partial_tx(self, der_suffix: Sequence[int], *,
       -                                                       only_der_suffix: bool = True) -> Tuple[bytes, Sequence[int]]:
       +    def get_fp_and_derivation_to_be_used_in_partial_tx(
       +            self,
       +            der_suffix: Sequence[int],
       +            *,
       +            only_der_suffix: bool,
       +    ) -> Tuple[bytes, Sequence[int]]:
                """Returns fingerprint and derivation path corresponding to a derivation suffix.
                The fingerprint is either the root fp or the intermediate fp, depending on what is available
                and 'only_der_suffix', and the derivation path is adjusted accordingly.
       t@@ -449,8 +453,12 @@ class Xpub(MasterPublicKeyMixin):
            def get_root_fingerprint(self) -> Optional[str]:
                return self._root_fingerprint
        
       -    def get_fp_and_derivation_to_be_used_in_partial_tx(self, der_suffix: Sequence[int], *,
       -                                                       only_der_suffix: bool = True) -> Tuple[bytes, Sequence[int]]:
       +    def get_fp_and_derivation_to_be_used_in_partial_tx(
       +            self,
       +            der_suffix: Sequence[int],
       +            *,
       +            only_der_suffix: bool,
       +    ) -> Tuple[bytes, Sequence[int]]:
                fingerprint_hex = self.get_root_fingerprint()
                der_prefix_str = self.get_derivation_prefix()
                if not only_der_suffix and fingerprint_hex is not None and der_prefix_str is not None:
       t@@ -721,8 +729,12 @@ class Old_KeyStore(MasterPublicKeyMixin, Deterministic_KeyStore):
                    self._root_fingerprint = xfp.hex().lower()
                return self._root_fingerprint
        
       -    def get_fp_and_derivation_to_be_used_in_partial_tx(self, der_suffix: Sequence[int], *,
       -                                                       only_der_suffix: bool = True) -> Tuple[bytes, Sequence[int]]:
       +    def get_fp_and_derivation_to_be_used_in_partial_tx(
       +            self,
       +            der_suffix: Sequence[int],
       +            *,
       +            only_der_suffix: bool,
       +    ) -> Tuple[bytes, Sequence[int]]:
                fingerprint_hex = self.get_root_fingerprint()
                der_prefix_str = self.get_derivation_prefix()
                fingerprint_bytes = bfh(fingerprint_hex)
   DIR diff --git a/electrum/tests/test_wallet_vertical.py b/electrum/tests/test_wallet_vertical.py
       t@@ -769,7 +769,7 @@ class TestWalletSending(TestCaseForTestnet):
                tx = wallet1a.mktx(outputs=outputs, password=None, fee=5000, tx_version=1)
                txid = tx.txid()
                partial_tx = tx.serialize_as_bytes().hex()
parazyd.org:70 /git/electrum/commit/c81551299ef470d8580b56c316be242a0b810d7c.gph:102: line too long