Browse Source

(trivial) add some type hints to wallet.get_tx_parents

master
SomberNight 3 years ago
parent
commit
57ae933582
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 8
      electrum/wallet.py

8
electrum/wallet.py

@ -884,7 +884,7 @@ class Abstract_Wallet(ABC, Logger, EventListener):
is_related_to_wallet=is_relevant,
)
def get_tx_parents(self, txid) -> Dict:
def get_tx_parents(self, txid: str) -> Dict[str, Tuple[List[str], List[str]]]:
"""
recursively calls itself and returns a flat dict:
txid -> list of parent txids
@ -901,9 +901,9 @@ class Abstract_Wallet(ABC, Logger, EventListener):
result = self._tx_parents_cache.get(txid, None)
if result is not None:
return result
result = {}
parents = []
uncles = []
result = {} # type: Dict[str, Tuple[List[str], List[str]]]
parents = [] # type: List[str]
uncles = [] # type: List[str]
tx = self.adb.get_transaction(txid)
assert tx, f"cannot find {txid} in db"
for i, txin in enumerate(tx.inputs()):

Loading…
Cancel
Save