mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 20:38:10 +00:00
[python] build_tx tool: fix amount inaccuracy by parsing with Decimal
This commit is contained in:
parent
b00c4209ed
commit
c63c727df0
@ -18,6 +18,7 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
import decimal
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from trezorlib import btc, messages, tools
|
from trezorlib import btc, messages, tools
|
||||||
@ -72,7 +73,7 @@ def _get_inputs_interactive(blockbook_url):
|
|||||||
if not r.ok:
|
if not r.ok:
|
||||||
raise click.ClickException(f"Failed to fetch URL: {tx_url}")
|
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:
|
if "error" in tx_json:
|
||||||
raise click.ClickException(f"Transaction not found: {txhash}")
|
raise click.ClickException(f"Transaction not found: {txhash}")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user