diff --git a/f469-disco b/f469-disco index b5a9c4c..0664448 160000 --- a/f469-disco +++ b/f469-disco @@ -1 +1 @@ -Subproject commit b5a9c4cb0b7e1ccc2ce708350b9fdd1ebd0f8aae +Subproject commit 0664448c616699fada37e4063f88170bc94df29b diff --git a/hwidevice.py b/hwidevice.py index 12e8679..06891ba 100644 --- a/hwidevice.py +++ b/hwidevice.py @@ -216,16 +216,18 @@ def enumerate(password=""): for port in serial.tools.list_ports.comports() if is_micropython(port) ] - try: - # check if there is a simulator on port 8789 - # and we can connect to it - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.connect(("127.0.0.1", 8789)) - s.close() - ports.append("127.0.0.1:8789") - except Exception as e: - print(e) - pass + for i in range(10): + try: + # check if there is a simulator on port 8789 + # and we can connect to it + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + port = 8789+i + s.connect(("127.0.0.1", port)) + s.close() + ports.append("127.0.0.1:%d" % port) + except Exception as e: + print(e) + pass for port in ports: # for every port try to get a fingerprint diff --git a/src/apps/wallets/liquid/manager.py b/src/apps/wallets/liquid/manager.py index 51d8ad7..782c875 100644 --- a/src/apps/wallets/liquid/manager.py +++ b/src/apps/wallets/liquid/manager.py @@ -156,7 +156,7 @@ async def confirm_transaction(self, wallets, meta, show_screen): # ask the user to label assets await self.check_unknown_assets(meta, show_screen) - return await super().confirm_transaction(wallets,meta, show_screen) + return await super().confirm_transaction(wallets, meta, show_screen) async def check_unknown_assets(self, meta, show_screen): @@ -231,16 +231,18 @@ async def confirm_transaction_final(self, wallets, meta, show_screen): spend = ", ".join("%s %s" % ("???" if val < 0 else "%.8f" % (val/1e8), self.asset_label(asset)) for asset, val in amount.items()) spends.append('%s\nfrom "%s"' % (spend, name)) title = "Inputs:\n" + "\n".join(spends) + if meta.get("issuance", False): + title = "Issuance transaction" + if meta.get("reissuance", False): + title = "Reissuance transaction" return await show_screen(TransactionScreen(title, meta)) def preprocess_psbt(self, stream, fout): """ Processes incoming PSBT, fills missing information and writes to fout. Returns: - - PSBTView class to use (PSBTView or PSETView) - wallets in inputs: list of tuples (wallet, amount) - metadata for tx display including warnings that require user confirmation - - default sighash to use for signing """ self.show_loader(title="Parsing transaction...") @@ -270,6 +272,7 @@ def preprocess_psbt(self, stream, fout): meta = { "inputs": [{} for i in range(psbtv.num_inputs)], "outputs": [{} for i in range(psbtv.num_outputs)], + "issuance": False, "reissuance": False, } fingerprint = self.keystore.fingerprint @@ -291,6 +294,12 @@ def preprocess_psbt(self, stream, fout): if inp.sighash_type is not None and inp.sighash_type != self.DEFAULT_SIGHASH: metainp["sighash"] = self.get_sighash_info(inp.sighash_type)["name"] + if inp.issue_value: + if inp.issue_entropy: + meta["reissuance"] = True + else: + meta["issuance"] = True + # in Liquid we may need to rewind the rangeproof to get values rangeproof_offset = None diff --git a/src/apps/wallets/manager.py b/src/apps/wallets/manager.py index 6f74584..2fb15ee 100644 --- a/src/apps/wallets/manager.py +++ b/src/apps/wallets/manager.py @@ -605,7 +605,6 @@ def preprocess_psbt(self, stream, fout): Returns: - wallets in inputs: dict {wallet: amount} - metadata for tx display including warnings that require user confirmation - - default sighash to use for signing """ self.show_loader(title="Parsing transaction...") diff --git a/src/config_default.py b/src/config_default.py index fc5eaf5..3179b5b 100644 --- a/src/config_default.py +++ b/src/config_default.py @@ -6,7 +6,10 @@ # to overwrite these settings create a config.py file if simulator: - storage_root = "./fs" + if len(sys.argv) > 1: + storage_root = sys.argv[1] + else: + storage_root = "./fs" try: os.mkdir(storage_root) except: diff --git a/src/gui/screens/transaction.py b/src/gui/screens/transaction.py index 082457d..3a630c0 100644 --- a/src/gui/screens/transaction.py +++ b/src/gui/screens/transaction.py @@ -17,6 +17,7 @@ def __init__(self, title, meta): enable_inputs = len([k for k in meta["inputs"] if k.get("sighash", "")]) > 0 # if there is at least one unknown value (liquid) enable_inputs = enable_inputs or (-1 in [out["value"] for out in meta["outputs"]]) + enable_inputs = enable_inputs or meta.get("issuance", False) or meta.get("reissuance", False) lbl = add_label("Show detailed information ", scr=self) lbl.align(obj, lv.ALIGN.CENTER, 0, 0) diff --git a/src/specter.py b/src/specter.py index 558bf9a..ca5f87f 100644 --- a/src/specter.py +++ b/src/specter.py @@ -324,6 +324,7 @@ async def select_network(self): ("test", "Testnet"), ("signet", "Signet"), ("regtest", "Regtest"), + ("liquidtestnet", "Liquid Testnet"), ("elementsregtest", "Liquid Regtest"), ] # wait for menu selection