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

fix(python): drop references to beta-wallet.trezor.io

This commit is contained in:
Pavol Rusnak 2020-11-14 17:03:56 +01:00 committed by matejcik
parent f0968e8f66
commit 225cd15732
3 changed files with 19 additions and 11 deletions

View File

@ -66,7 +66,7 @@ A provided script can be used to sign transactions interactively. You will need
5) Amount to send in satoshis - ``91305`` in the example below (multiply BTC amount 0.00091305 by 100,000,000).
6) Expected fee (``0.00019695`` BTC in example below). Note: the miner receives all satoshis left unspent from a transaction. If you want to receive some change, you need to send it to an address you own (otherwise it will go to miner). Fee is not needed below, we just want it as a sanity check.
There are many ways to retrieve the info above: from a watch-only wallet in Bitcoin Core, https://coinb.in (`screenshot <sign_tx-coinb.in.png>`_) etc. The easiest way is using the Trezor online wallet: https://beta-wallet.trezor.io
There are many ways to retrieve the info above: from a watch-only wallet in Bitcoin Core, https://coinb.in (`screenshot <sign_tx-coinb.in.png>`_) etc. The easiest way is using the Trezor Suite: https://suite.trezor.io
After authenticating, open the "Send" tab, fill-out all details, then open the "Show transaction details" menu to see the info needed above (`screenshot <sign_tx-trezor.io.png>`_). Once you have the required details, you can then perform the transaction signing using ``trezorctl`` as shown in the example below:
@ -96,7 +96,7 @@ After authenticating, open the "Send" tab, fill-out all details, then open the "
Signed Transaction:
02000000014ee601d273df3fe31f4bd79ad483d89973fe2d626faff316(...)
The signed transaction text can then be inspected in Electrum (`screenshot <sign_tx-electrum2.png>`_), `coinb.in <https://coinb.in/?verify=01000000014ee601d273df3fe31f4bd79ad483d89973fe2d626faff31605a39ca95a71eaa5000000006a47304402206386a0ad0f0b196d375a0805eee2aebe4644032c2998aaf00e43ce68a293986702202ad25964844657e10130f81201b7d87eb8047cf0c09dfdcbbe68a1a732e80ded012103b375a0dd50c8dbc4a6156a55e31274ee0537191e1bc824a09278a220fafba2dbffffffff01a96401000000000017a914d53d47ccd1579b93c284e9caf3c81f3f417871698700000000#verify>`_ or another tool. If all info is correct, you can then broadcast the tx to the Bitcoin network via the URL provided by ``trezorctl`` or Electrum (Tools → Load transaction → From text. Here is a `screenshot <sign_tx-electrum1.png>`_). TIP: Electrum will only show the transaction fee if you previously imported the spending address (eg ``16ijWp48xn8hj6deD5ZHSJcgNjtYbpiki8`` from example tx above). Also, the final tx size (and therefore satoshis / byte) might be slightly different than the estimate shown on beta-wallet.trezor.io
The signed transaction text can then be inspected in Electrum (`screenshot <sign_tx-electrum2.png>`_), `coinb.in <https://coinb.in/?verify=01000000014ee601d273df3fe31f4bd79ad483d89973fe2d626faff31605a39ca95a71eaa5000000006a47304402206386a0ad0f0b196d375a0805eee2aebe4644032c2998aaf00e43ce68a293986702202ad25964844657e10130f81201b7d87eb8047cf0c09dfdcbbe68a1a732e80ded012103b375a0dd50c8dbc4a6156a55e31274ee0537191e1bc824a09278a220fafba2dbffffffff01a96401000000000017a914d53d47ccd1579b93c284e9caf3c81f3f417871698700000000#verify>`_ or another tool. If all info is correct, you can then broadcast the tx to the Bitcoin network via the URL provided by ``trezorctl`` or Electrum (Tools → Load transaction → From text. Here is a `screenshot <sign_tx-electrum1.png>`_). TIP: Electrum will only show the transaction fee if you previously imported the spending address (eg ``16ijWp48xn8hj6deD5ZHSJcgNjtYbpiki8`` from example tx above). Also, the final tx size (and therefore satoshis / byte) might be slightly different than the estimate shown on suite.trezor.io
The final broadcast and mined transaction can be seen here: https://blockchain.info/tx/270684c14be85efec9adafa50339fd120658381ed2300b9207d0a0df2a5f0bf9

View File

@ -2,7 +2,7 @@
import os
import requests
RELEASES_URL = "https://beta-wallet.trezor.io/data/firmware/{}/releases.json"
RELEASES_URL = "https://data.trezor.io/firmware/{}/releases.json"
MODELS = ("1", "T")
FILENAME = os.path.join(os.path.dirname(__file__), "..", "trezorlib", "__init__.py")

View File

@ -84,16 +84,24 @@ def validate_firmware(version, fw, expected_fingerprint=None):
def find_best_firmware_version(
bootloader_version, requested_version=None, beta=False, bitcoin_only=False
):
if beta:
url = "https://beta-wallet.trezor.io/data/firmware/{}/releases.json"
else:
url = "https://wallet.trezor.io/data/firmware/{}/releases.json"
url = "https://data.trezor.io/firmware/{}/releases.json"
releases = requests.get(url.format(bootloader_version[0])).json()
if not releases:
raise click.ClickException("Failed to get list of releases")
if bitcoin_only:
releases = [r for r in releases if "url_bitcoinonly" in r]
# filter releases according to channel field
releases_stable = [
r for r in releases if "channel" not in r or r["channel"] == "stable"
]
releases_beta = [r for r in releases if "channel" in r and r["channel"] == "beta"]
if beta:
releases = releases_stable + releases_beta
else:
releases = releases_stable
releases.sort(key=lambda r: r["version"], reverse=True)
def version_str(version):
@ -158,10 +166,10 @@ def find_best_firmware_version(
else:
url = release["url"]
fingerprint = release["fingerprint"]
if beta:
url = "https://beta-wallet.trezor.io/" + url
else:
url = "https://wallet.trezor.io/" + url
if not url.startswith("data/"):
click.echo("Unsupported URL found: {}".format(url))
sys.exit(1)
url = "https://data.trezor.io/" + url[5:]
return url, fingerprint