mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
tests: Fix tx_cache download.
This commit is contained in:
parent
e9fd1fc49f
commit
b0f2d43884
@ -107,7 +107,10 @@ def cli(tx, coin_name):
|
||||
|
||||
click.echo(f"Fetching from {tx_url}...")
|
||||
try:
|
||||
tx_src = requests.get(tx_url).json(parse_float=Decimal)
|
||||
# Get transaction from Blockbook server. The servers refuse requests with an empty user agent.
|
||||
tx_src = requests.get(tx_url, headers={"user-agent": "tx_cache"}).json(
|
||||
parse_float=Decimal
|
||||
)
|
||||
tx_proto = btc.from_json(tx_src)
|
||||
tx_dict = protobuf.to_dict(tx_proto)
|
||||
tx_json = json.dumps(tx_dict, sort_keys=True, indent=2) + "\n"
|
||||
|
Loading…
Reference in New Issue
Block a user