(trivial) add some type hints to wallet.get_tx_parents
This commit is contained in:
@@ -884,7 +884,7 @@ class Abstract_Wallet(ABC, Logger, EventListener):
|
|||||||
is_related_to_wallet=is_relevant,
|
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:
|
recursively calls itself and returns a flat dict:
|
||||||
txid -> list of parent txids
|
txid -> list of parent txids
|
||||||
@@ -901,9 +901,9 @@ class Abstract_Wallet(ABC, Logger, EventListener):
|
|||||||
result = self._tx_parents_cache.get(txid, None)
|
result = self._tx_parents_cache.get(txid, None)
|
||||||
if result is not None:
|
if result is not None:
|
||||||
return result
|
return result
|
||||||
result = {}
|
result = {} # type: Dict[str, Tuple[List[str], List[str]]]
|
||||||
parents = []
|
parents = [] # type: List[str]
|
||||||
uncles = []
|
uncles = [] # type: List[str]
|
||||||
tx = self.adb.get_transaction(txid)
|
tx = self.adb.get_transaction(txid)
|
||||||
assert tx, f"cannot find {txid} in db"
|
assert tx, f"cannot find {txid} in db"
|
||||||
for i, txin in enumerate(tx.inputs()):
|
for i, txin in enumerate(tx.inputs()):
|
||||||
|
|||||||
Reference in New Issue
Block a user