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 9, 2022
1 parent e69cdad commit 5da0270
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 @@ -90,7 +90,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 @@ -287,7 +288,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 5da0270

Please sign in to comment.