tests: Fix tx_cache download.

omikle/double_reset_dialog
Andrew Kozlik 2 years ago committed by Andrew Kozlik
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…
Cancel
Save