Skip to content

Commit

Permalink
fix ledger output json parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kkonevets committed Nov 8, 2022
1 parent 6184819 commit 9a7a884
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def solido(*args: str, keypair_path: Optional[str] = None) -> Any:
*args,
)
if keypair_path is not None and keypair_path.startswith('usb://ledger'):
output = '\n'.join(output.split('\n')[2:])
# get json at the end of output
output = output[output.find("{") :]
if output == '':
return {}
else:
Expand Down Expand Up @@ -277,7 +278,8 @@ def multisig(*args: str, keypair_path: Optional[str] = None) -> Any:
# ✅ Approved
# These lines should be ignored
if keypair_path is not None and keypair_path.startswith('usb://ledger'):
output = '\n'.join(output.split('\n')[2:])
# get json at the end of output
output = output[output.find("{") :]
if output == '':
return {}
else:
Expand Down

0 comments on commit 9a7a884

Please sign in to comment.