1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 04:18:10 +00:00

[python] build_tx tool: fix amount inaccuracy by parsing with Decimal

This commit is contained in:
mcudev 2020-09-13 01:43:19 -04:00 committed by matejcik
parent b00c4209ed
commit c63c727df0

View File

@ -18,6 +18,7 @@
import json
import click
import decimal
import requests
from trezorlib import btc, messages, tools
@ -72,7 +73,7 @@ def _get_inputs_interactive(blockbook_url):
if not r.ok:
raise click.ClickException(f"Failed to fetch URL: {tx_url}")
tx_json = r.json()
tx_json = r.json(parse_float=decimal.Decimal)
if "error" in tx_json:
raise click.ClickException(f"Transaction not found: {txhash}")