Merge pull request #167 from kdmukai/0.5.0-pre3

Support for Nunchuk animated multisig wallet descriptors
This commit is contained in:
SeedSigner
2022-03-29 12:43:13 -05:00
committed by GitHub
2 changed files with 5 additions and 3 deletions
+4 -3
View File
@@ -212,7 +212,7 @@ class DecodeQR:
if not self.decoder: if not self.decoder:
return 0 return 0
if self.qr_type in [QRType.PSBT__UR2, QRType.OUTPUT__UR, QRType.ACCOUNT__UR]: if self.qr_type in [QRType.PSBT__UR2, QRType.OUTPUT__UR, QRType.ACCOUNT__UR, QRType.BYTES__UR]:
return int(self.decoder.estimated_percent_complete() * 100) return int(self.decoder.estimated_percent_complete() * 100)
elif self.qr_type in [QRType.PSBT__SPECTER]: elif self.qr_type in [QRType.PSBT__SPECTER]:
@@ -278,7 +278,8 @@ class DecodeQR:
if self.qr_type in [QRType.BYTES__UR]: if self.qr_type in [QRType.BYTES__UR]:
cbor = self.decoder.result_message().cbor cbor = self.decoder.result_message().cbor
raw = Bytes.from_cbor(cbor).data raw = Bytes.from_cbor(cbor).data
check = 'multisig setup file' in raw.decode("utf-8").lower() data = raw.decode("utf-8").lower()
check = 'policy:' in data and "format:" in data and "derivation:" in data
return check return check
@@ -572,7 +573,7 @@ class DecodeQR:
descriptor += ',[' + x['xfp'] + derivation + "]" + x['key'] + "/{0,1}/*" descriptor += ',[' + x['xfp'] + derivation + "]" + x['key'] + "/{0,1}/*"
descriptor += script_close descriptor += script_close
return descriptor return descriptor
class BaseQrDecoder: class BaseQrDecoder:
+1
View File
@@ -79,6 +79,7 @@ class ScanView(View):
if not descriptor.is_basic_multisig: if not descriptor.is_basic_multisig:
# TODO: Handle single-sig descriptors? # TODO: Handle single-sig descriptors?
print(f"Received single sig descriptor: {descriptor}")
return Destination(NotYetImplementedView) return Destination(NotYetImplementedView)
self.controller.multisig_wallet_descriptor = descriptor self.controller.multisig_wallet_descriptor = descriptor