Skip to content

Commit

Permalink
Merge pull request #167 from kdmukai/0.5.0-pre3
Browse files Browse the repository at this point in the history
Support for Nunchuk animated multisig wallet descriptors
  • Loading branch information
SeedSigner authored Mar 29, 2022
2 parents b007ae9 + e8ed183 commit 224451b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/seedsigner/models/decode_qr.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def get_percent_complete(self) -> int:
if not self.decoder:
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)

elif self.qr_type in [QRType.PSBT__SPECTER]:
Expand Down Expand Up @@ -278,7 +278,8 @@ def is_wallet_descriptor(self):
if self.qr_type in [QRType.BYTES__UR]:
cbor = self.decoder.result_message().cbor
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

Expand Down Expand Up @@ -572,7 +573,7 @@ def multisig_setup_file_to_descriptor(text) -> str:
descriptor += ',[' + x['xfp'] + derivation + "]" + x['key'] + "/{0,1}/*"

descriptor += script_close

return descriptor

class BaseQrDecoder:
Expand Down
1 change: 1 addition & 0 deletions src/seedsigner/views/scan_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def run(self):

if not descriptor.is_basic_multisig:
# TODO: Handle single-sig descriptors?
print(f"Received single sig descriptor: {descriptor}")
return Destination(NotYetImplementedView)

self.controller.multisig_wallet_descriptor = descriptor
Expand Down

0 comments on commit 224451b

Please sign in to comment.