Skip to content

Commit 33a8480

Browse files
committed
Add Trezor compatibility test and group reqs to cover; v14.0.2
1 parent 35089e3 commit 33a8480

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

slip39/api_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@ def test_slip39_extendable_trezor_compatibility():
237237
account.from_mnemonic( "\n".join(mnemonics), slip39_passphrase='TREZOR', path="m/" )
238238
assert account.xprvkey == "xprv9s21ZrQH143K4FS1qQdXYAFVAHiSAnjj21YAKGh2CqUPJ2yQhMmYGT4e5a2tyGLiVsRgTEvajXkxhg92zJ8zmWZas9LguQWz7WZShfJg6RS"
239239

240+
def test_slip39_compatibility():
241+
"""Test that SLIP-39 backup of a wallet generated by Trezor can be recevered"""
242+
# The 1th vector from https://github.com/trezor/python-shamir-mnemonic/blob/master/vectors.json
243+
mnemonics = [
244+
"duckling enlarge academic academic agency result length solution fridge kidney coal piece deal husband erode duke ajar critical decision keyboard"
245+
]
246+
account = Account( crypto="Bitcoin", format="legacy" )
247+
account.from_mnemonic( "\n".join(mnemonics), slip39_passphrase='TREZOR', path="m/" )
248+
assert account.xprvkey == "xprv9s21ZrQH143K4QViKpwKCpS2zVbz8GrZgpEchMDg6KME9HZtjfL7iThE9w5muQA4YPHKN1u5VM1w8D4pvnjxa2BmpGMfXr7hnRrRHZ93awZ"
240249

241250
def test_account_from_mnemonic():
242251
"""Test all the ways the entropy 0xffff...ffff can be encoded and HD Wallets derived."""

slip39/layout/pdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def produce_pdf(
326326
cover_text += "\n"
327327

328328
tpl_cover['cover-text'] = cover_text
329-
cover_sent = "SLIP-39 Mnemonic Card Recipients:\n\n"
329+
cover_sent = f"SLIP-39 Group Recipients ({group_threshold} of {len(group_reqs)}):\n\n"
330330
cover_sent += "\n".join( slip39_group )
331331
tpl_cover['cover-sent'] = cover_sent
332332

slip39/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version_info__ = ( 14, 0, 0 )
1+
__version_info__ = ( 14, 0, 2 )
22
__version__ = '.'.join( map( str, __version_info__ ))

0 commit comments

Comments
 (0)