1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-17 05:03:07 +00:00

style(python): use 'h' for hardening instead of apostrophe (fixes #3037)

This commit is contained in:
matejcik 2023-10-18 16:15:45 +02:00
parent e590efaddd
commit 7d8a57a806
15 changed files with 18 additions and 17 deletions

View File

@ -0,0 +1 @@
Use 'h' character for hardened BIP-32 components in help texts.

View File

@ -191,17 +191,17 @@ The JSON below encodes a transaction with the following inputs:
* [e9cec1644db8fa95fe639a9b503a63ea587d2f4e480d3847703e3ec73adf6b5a](https://btc5.trezor.io/tx/e9cec1644db8fa95fe639a9b503a63ea587d2f4e480d3847703e3ec73adf6b5a)
output **0** (P2PKH address 1Jw5FrKhi2aWbbF4h3QRWLog5AjsJYGswv)
at derivation path **m/44'/0'/0'/0/282**
at derivation path **m/44h/0h/0h/0/282**
amount **85 170** sat
* [1f545c0ca1f2c055e199c70457025c1e393edd013a274a976187115a5c601155](https://btc5.trezor.io/tx/1f545c0ca1f2c055e199c70457025c1e393edd013a274a976187115a5c601155)
output **0** (P2SH-SegWit address 3DEAk9KGrgvj2gHQ1hyfCXus9hZr9K8Beh)
at derivation path **m/49'/0'/0'/0/55**
at derivation path **m/49h/0h/0h/0/55**
amount **500 000** sat
And the following outputs:
* **12 345** sat to address **3DDEgt7quAq7XqoG6PjVXi1eeAea4rfWck**
* **562 825** sat to a P2SH-SegWit change address at derivation path **m/49'/0'/0'/1/99**
* **562 825** sat to a P2SH-SegWit change address at derivation path **m/49h/0h/0h/1/99**
* fee of 10 000 sat
(Note that Trezor does not support change addresses when mixing input types. The example

View File

@ -27,7 +27,7 @@ if TYPE_CHECKING:
from ..client import TrezorClient
PATH_HELP = "BIP-32 path to key, e.g. m/44'/714'/0'/0/0"
PATH_HELP = "BIP-32 path to key, e.g. m/44h/714h/0h/0/0"
@click.group(name="binance")

View File

@ -25,7 +25,7 @@ from . import ChoiceType, with_client
if TYPE_CHECKING:
from ..client import TrezorClient
PATH_HELP = "BIP-32 path to key, e.g. m/44'/1815'/0'/0/0"
PATH_HELP = "BIP-32 path to key, e.g. m/44h/1815h/0h/0/0"
TESTNET_CHOICES = {
"preprod": "testnet_preprod",

View File

@ -25,7 +25,7 @@ if TYPE_CHECKING:
from .. import messages
from ..client import TrezorClient
PATH_HELP = "BIP-32 path, e.g. m/10018'/0'"
PATH_HELP = "BIP-32 path, e.g. m/10018h/0h"
@click.group(name="cosi")

View File

@ -49,7 +49,7 @@ def get_entropy(client: "TrezorClient", size: int) -> str:
@cli.command()
@click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/10016'/0")
@click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/10016h/0")
@click.option(
"-p", "--prompt", type=PROMPT_TYPE, default="always", help="Prompt for passphrase"
)
@ -85,7 +85,7 @@ def encrypt_keyvalue(
@cli.command()
@click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/10016'/0")
@click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/10016h/0")
@click.option(
"-p", "--prompt", type=PROMPT_TYPE, default="always", help="Prompt for passphrase"
)

View File

@ -26,7 +26,7 @@ if TYPE_CHECKING:
from .. import messages
from ..client import TrezorClient
PATH_HELP = "BIP-32 path, e.g. m/44'/194'/0'/0/0"
PATH_HELP = "BIP-32 path, e.g. m/44h/194h/0h/0/0"
@click.group(name="eos")

View File

@ -35,7 +35,7 @@ if TYPE_CHECKING:
from ..client import TrezorClient
PATH_HELP = "BIP-32 path, e.g. m/44'/60'/0'/0/0"
PATH_HELP = "BIP-32 path, e.g. m/44h/60h/0h/0/0"
# fmt: off
ETHER_UNITS = {

View File

@ -24,7 +24,7 @@ from . import ChoiceType, with_client
if TYPE_CHECKING:
from ..client import TrezorClient
PATH_HELP = "BIP-32 path, e.g. m/44'/128'/0'"
PATH_HELP = "BIP-32 path, e.g. m/44h/128h/0h"
@click.group(name="monero")

View File

@ -26,7 +26,7 @@ from . import with_client
if TYPE_CHECKING:
from ..client import TrezorClient
PATH_HELP = "BIP-32 path, e.g. m/44'/134'/0'/0'"
PATH_HELP = "BIP-32 path, e.g. m/44h/134h/0h/0h"
@click.group(name="nem")

View File

@ -25,7 +25,7 @@ from . import with_client
if TYPE_CHECKING:
from ..client import TrezorClient
PATH_HELP = "BIP-32 path to key, e.g. m/44'/144'/0'/0/0"
PATH_HELP = "BIP-32 path to key, e.g. m/44h/144h/0h/0/0"
@click.group(name="ripple")

View File

@ -34,7 +34,7 @@ try:
except ImportError:
pass
PATH_HELP = "BIP32 path. Always use hardened paths and the m/44'/148'/ prefix"
PATH_HELP = "BIP32 path. Always use hardened paths and the m/44h/148h/ prefix"
@click.group(name="stellar")

View File

@ -25,7 +25,7 @@ from . import with_client
if TYPE_CHECKING:
from ..client import TrezorClient
PATH_HELP = "BIP-32 path, e.g. m/44'/1729'/0'"
PATH_HELP = "BIP-32 path, e.g. m/44h/1729h/0h"
@click.group(name="tezos")

View File

@ -29,7 +29,7 @@ def main() -> None:
print(client.features)
# Get the first address of first BIP44 account
bip32_path = parse_path("44'/0'/0'/0/0")
bip32_path = parse_path("44h/0h/0h/0/0")
address = btc.get_address(client, "Bitcoin", bip32_path, True)
print("Bitcoin address:", address)

View File

@ -84,7 +84,7 @@ def get_passphrase_from_user(available_on_device: bool = False) -> str:
def get_address() -> str:
args = """
trezorctl --script get-address -n "m/49'/0'/0'/0/0"
trezorctl --script get-address -n "m/49h/0h/0h/0/0"
""".strip()
p = subprocess.Popen( # type: ignore [No overloads for "__new__" match the provided arguments]
args,