Skip to content

Commit 48661d2

Browse files
committed
Corrected use of produce_pdf paper handling, tested BIP-38 Paper Wallet
1 parent 050f4dd commit 48661d2

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

SLIP-39-macOS.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ coll = COLLECT(exe,
5050
app = BUNDLE(coll,
5151
name='SLIP-39.app',
5252
icon='images/SLIP-39.icns',
53-
version='8.0.0',
53+
version='8.0.1',
5454
info_plist={
55-
'CFBundleVersion':'8.0.0',
55+
'CFBundleVersion':'8.0.1',
5656
'CFBundlePackageType':'APPL',
5757
'LSApplicationCategoryType':'public.app-category.finance',
5858
'LSMinimumSystemVersion':'10.15.0',

slip39/api_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ def test_account_encrypt():
128128
'Satoshi'
129129
).key.upper() == '09C2686880095B1A4C249EE3AC4EEA8A014F11E6F986D0B5025AC1F39AFBD9AE'
130130

131+
# Test some addresses encrypted by our Paper Wallet PDF output procedure, using
132+
# the "zoo zoo ... zoo wrong" BIP-39 test Mnemonic.
133+
assert Account( crypto='BTC' ).from_encrypted(
134+
'6PYSUhj4mPTNdSvm2dxLRszieSBmzPqPQX699ECUrd69sWteFAUqmW1FLq',
135+
'something'
136+
).address == 'bc1qk0a9hr7wjfxeenz9nwenw9flhq0tmsf6vsgnn2'
137+
131138

132139
@substitute( shamir_mnemonic.shamir, 'RANDOM_BYTES', nonrandom_bytes )
133140
def test_create():

slip39/layout/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ def write_pdfs(
692692
# Generate each desired SLIP-39 Mnemonic file. Supports --card (the default). Remember any
693693
# deduced orientation and paper_format for below.
694694
results = {}
695-
(orientation,paper_format),pdf = (None,None),None
695+
(pdf_paper,pdf_orient),pdf = (None,None),None
696696
for name, details in names.items():
697697
# Get the first group of the accountgroups in details.accounts.
698698
accounts = details.accounts
@@ -709,9 +709,9 @@ def write_pdfs(
709709
print( f"{name}{name and ': ' or ''}{mnem}" )
710710

711711
# Unless no card_format (False) or paper wallet password specified, produce a PDF containing
712-
# the SLIP-39 mnemonic recovery cards; remember the deduced (<orientation>,<paper>)
712+
# the SLIP-39 mnemonic recovery cards; remember the deduced (<pdf_paper>,<pdf_orient>)
713713
if card_format is not False or wallet_pwd:
714-
(orientation,paper_format),pdf,_ = produce_pdf(
714+
(pdf_paper,pdf_orient),pdf,_ = produce_pdf(
715715
*details,
716716
card_format = card_format or CARD,
717717
paper_format = paper_format or PAPER
@@ -904,8 +904,8 @@ def write_pdfs(
904904
printer_output(
905905
pdf.output(),
906906
printer = printer,
907-
orientation = orientation,
908-
paper_format = paper_format,
907+
orientation = pdf_orient,
908+
paper_format = pdf_paper,
909909
)
910910

911911
results[pdf_name] = details

slip39/version.py

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

0 commit comments

Comments
 (0)