1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 12:08:59 +00:00
Commit Graph

118 Commits

Author SHA1 Message Date
Alois Klink
5c4703c9bb fix(core,legacy): Fix domain-only ethTypedData
When doing Ethereum signTypedData, and the primaryType="EIP712Domain",
we completely ignore the "message" part and only sign the domain.

According to the community, this is technically allowed by the spec,
and may be used by ETH smart contracts to save on gas.

Test case generated by @MetaMask/eth-sig-util's library.

See: https://ethereum-magicians.org/t/eip-712-standards-clarification-primarytype-as-domaintype/3286
2022-01-14 14:22:46 +01:00
grdddj
e3d366e65b feat(python): ScriptUI for trezorctl, reference client implementation 2022-01-12 14:52:01 +01:00
matejcik
dfab3efb86 style(python): fix typecheck issues
[no changelog]
2022-01-07 21:41:17 +01:00
Alisina Bahadori
77ab865386 feat(legacy): Implement EIP-712 signing 2021-12-19 20:36:30 +01:00
matejcik
38fca4a83d chore(python): regenerate GNU copyright headers 2021-12-07 16:55:58 +01:00
matejcik
83bb3a0932 feat(python): show progress bar for firmware upload 2021-12-07 16:55:58 +01:00
matejcik
a2a8cc88d9 feat(python): make the protobuf mappings overridable 2021-12-07 16:55:58 +01:00
grdddj
1a0b590914 feat(python): add full type information
WIP - typing the trezorctl apps

typing functions trezorlib/cli

addressing most of mypy issue for trezorlib apps and _internal folder

fixing broken device tests by changing asserts in debuglink.py

addressing most of mypy issues in trezorlib/cli folder

adding types to some untyped functions, mypy section in setup.cfg

typing what can be typed, some mypy fixes, resolving circular import issues

importing type objects in "if TYPE_CHECKING:" branch

fixing CI by removing assert in emulator, better ignore comments

CI assert fix, style fixes, new config options

fixup! CI assert fix, style fixes, new config options

type fixes after rebasing on master

fixing python3.6 and 3.7 unittests by importing Literal from typing_extensions

couple mypy and style fixes

fixes and improvements from code review

silencing all but one mypy issues

trial of typing the tools.expect function

fixup! trial of typing the tools.expect function

@expect and @session decorators correctly type-checked

Optional args in CLI where relevant, not using general list/tuple/dict where possible

python/Makefile commands, adding them into CI, ignoring last mypy issue

documenting overload for expect decorator, two mypy fixes coming from that

black style fix

improved typing of decorators, pyright config file

addressing or ignoring pyright errors, replacing mypy in CI by pyright

fixing incomplete assert causing device tests to fail

pyright issue that showed in CI but not locally, printing pyright version in CI

fixup! pyright issue that showed in CI but not locally, printing pyright version in CI

unifying type:ignore statements for pyright usage

resolving PIL.Image issues, pyrightconfig not excluding anything

replacing couple asserts with TypeGuard on safe_issubclass

better error handling of usb1 import for webusb

better error handling of hid import

small typing details found out by strict pyright mode

improvements from code review

chore(python): changing List to Sequence for protobuf messages

small code changes to reflect the protobuf change to Sequence

importing TypedDict from typing_extensions to support 3.6 and 3.7

simplify _format_access_list function

fixup! simplify _format_access_list function

typing tools folder

typing helper-scripts folder

some click typing

enforcing all functions to have typed arguments

reverting the changed argument name in tools

replacing TransportType with Transport

making PinMatrixRequest.type protobuf attribute required

reverting the protobuf change, making argument into get_pin Optional

small fixes in asserts

solving the session decorator type issues

fixup! solving the session decorator type issues

improvements from code review

fixing new pyright errors introduced after version increase

changing -> Iterable to -> Sequence in enumerate_devices, change in wait_for_devices

style change in debuglink.py

chore(python): adding type annotation to Sequences in messages.py

better "self and cls" types on Transport

fixup! better "self and cls" types on Transport

fixing some easy things from strict pyright run
2021-11-26 16:28:49 +01:00
Pavol Rusnak
0fc3b32b7e fix(python): accept also "taproot" for taproot scripts in cli
[no changelog]
2021-11-22 11:25:19 +01:00
matejcik
f8b9cda05d feat(python): support Cardano derivation type arguments 2021-11-10 13:57:57 +01:00
Pavol Rusnak
0068c12f77
fix(python): use unified descriptor format <a;b> (#1885) 2021-11-04 10:36:53 +01:00
grdddj
73238135d6 feat(core/ethereum): EIP-712
Based on original contribution by Max Kupriianov <xlab@hey.com>

Implemented EIP-712 typed data signatures in Ethereum app.

Add eth_abi into pyproject deps

device test for EIP 712

fixed hex decoding for address

fixup! fixed hex decoding for address

code quality, more pythonic code, removing unused imports

running black and isort on changed files

trezorctl file input for EIP 712 data signing

fixup! code quality, more pythonic code, removing unused imports

fixup! fixup! code quality, more pythonic code, removing unused imports

necessary changes after rebase to master

unit tests for sign_typed_data.py

new protobuf messages, working for nonarray types

simplified and verified solution for our simple data

support for simple arrays, without their confirmation

reverting protobuf value messages to bytes, appropriate changes

showing arrays in Trezor, code quality improvements

data validation on Trezor, minor improvements

using custom types for storing type data instead of dicts, addressing feedback from review

moving helper functions to its own file, tests for decode_data

additional overall tests

support for arrays of structs

adding support for metamask_v4_compat variable

using HashWriter object to collect the final hash continously

minor improvements in code quality

validate_field_type function

streaming values from client without saving them, missing UI

prototype of streamed UI using confirm_properties

accounting for bytes in data, more data types in integration tests

rebase on master, using f-strings

minor fixes and improvements from code review

StructHasher class for the whole hashing process

mypy and style changes

asking users whether to show structs and arrays

protobuf descriptions to fix make defs_check

unifying comments, mypy fix

unit tests for StructHasher class

UI fixtures, skipping device tests for T1

addressing majority of code review comments about code quality and structure

changing file structure - layouts, helpers, sign_typed_data

decode_data renaming and docstring, renaming unit test file

using tuples instead of lists in elifs

layout improvements

excluding core/src/apps/common/confirm.py file from the PR

True/False returning layout with Show more button

code review layout improvements

forgotten br_type argument to should_show_more
2021-11-02 14:27:01 +01:00
Eduard Klementiev
10ce81b5d1 fix(python/trezorctl): fix operator precedence issue for ethereum sign-tx command 2021-10-25 15:51:21 +02:00
Pavol Rusnak
ba0879961c feat(python): add support for Taproot descriptors 2021-10-18 13:36:05 +02:00
amadejpapez
85ba7c12ba style(all): use f-strings for formatting
[no changelog]
2021-10-13 11:53:17 +02:00
gabrielkerekes
1f33ab420d feat(cardano): update transaction signing for multisig 2021-10-11 15:16:24 +02:00
gabrielkerekes
21281d7cf4 feat(cardano): add support for script addresses derivation 2021-10-11 15:16:24 +02:00
gabrielkerekes
dd9652cd07 feat(cardano): add get-native-script-hash call 2021-10-11 15:16:24 +02:00
matejcik
f083beb3c2 fix(python/trezorctl): fix "invalid value" of ChoiceType with default
[no changelog] as the changelog entry is explicitly added to previous
version
2021-09-07 13:37:23 +02:00
gabrielkerekes
b0c8590f00 feat(cardano): streamed transaction signing 2021-08-20 11:50:13 +02:00
matejcik
ee068b01ea chore(python): remove Lisk 2021-08-19 10:25:41 +02:00
Frederik Bolding
38fa9197ca feat(core,python): support for Ethereum EIP1559 transactions
Initial EIP1559 implementation

Fix a few small issues

Progress on Python lib implementation and firmware

Fix RLP length

Start fixing tests

Fix legacy transactions

Simplify API and logic

Add EIP1559 tests

Fix access list formatting

Fix UI visiblity issue

Fix commented out code

fix: correct linting issues

Fix access_list protobuf formatting

Remove unneeded code

Remove dead code

Check tx_type bounds for EIP 2718

Reduce code duplication

Prefer eip2718_type over re-using tx_type

Add more tests

Simplify format_access_list

Simplify sign_tx slightly

Change Access List format and add logic to encode it

Fix a bunch of small PR comments

Fix a linting issue

Move tests out of class and regenerate

Remove copy-pasted comments

Add access list to CLI

Simplify _parse_access_list_item

Fix small mistakes following rebase

Fix linting

Refactor to use a separate message for EIP 1559 tx

Simplify changed legacy code

Fix a few small PR comments

Fix linting

fix(legacy): recognize SignTxEIP1559 on legacy build

Fix PR comments
2021-08-10 11:00:29 +02:00
overcat
5cf873a03a feat(python/stellar): print a readable message when the user has not submitted a base64-encoded transaction envelope. 2021-08-06 13:14:57 +02:00
Jun Luo
543b9f407c refactor(python/stellar): Use Stellar Python SDK to parse Stellar transactions.
As a side effect, support for TransactionV1 format transaction is added.
2021-08-06 13:14:57 +02:00
matejcik
e7c40c9560 feat(python/trezorctl): trezorctl device reboot-to-bootloader 2021-07-29 15:32:42 +02:00
grdddj
13b8a6e54d fix(python/trezorctl): firmware download does not require connected trezor 2021-07-20 11:03:57 +02:00
grdddj
6bbc9a78f3 feat(python/trezorctl): improving and refactoring firmware CLI commands 2021-07-07 10:33:03 +02:00
gabrielkerekes
a3d0016a2f refactor(trezorlib/cardano): rename create_* functions
To avoid ambiguity between creating messages from parameters and parsing them from JSON.
2021-04-23 11:09:29 +02:00
gabrielkerekes
2313293477 feat(core/cardano): add support for catalyst voting registration 2021-04-23 11:09:29 +02:00
Pavol Rusnak
65cefbc879
docs: remove wallet.trezor.io references 2021-04-16 16:18:48 +02:00
mcudev
23abf7aff0 python/trezorctl: make bitcoin regtest a supported coin for trezorctl btc get-descriptor 2021-03-25 15:52:34 +01:00
matejcik
cb7152542d feat: drop DebugLinkShowText functionality 2021-03-18 10:59:51 +01:00
Pavol Rusnak
10edcb0d3a
doc(python): change wording from beta wallet to beta channel
[skip_ci]
2021-03-02 10:39:20 +01:00
Pavol Rusnak
48d1a7a880
fix(python): append checksum to descriptors (#1445) 2021-02-05 17:46:02 +01:00
Pavol Rusnak
81ae1d0ec0
fix(python): remove extraneous empty line from descriptors output
[skip_ci]
2021-02-03 14:58:30 +01:00
Rafael Korbas
e4c406822c Add multiasset sending and min validity to Cardano transactions 2021-01-27 18:26:40 +01:00
Rafael Korbas
44c7d23741 Cardano: map account paths to account numbers 2021-01-22 14:45:29 +01:00
Pavol Rusnak
88889472eb feat(python): add btc get-descriptor command 2021-01-08 14:17:09 +01:00
Rafael Korbas
b311bd4d4a Add displaying of TTL to cardano transaction, align url validation with Ledger 2020-11-20 15:58:50 +01:00
Pavol Rusnak
225cd15732 fix(python): drop references to beta-wallet.trezor.io 2020-11-16 09:45:42 +01:00
matejcik
5005a61eaf fix(python): update trezorctl multisig feature to new API 2020-10-30 10:25:51 +01:00
matejcik
3d6d1a56ac feat(python): implement API compatibility with trezorlib 0.12 2020-10-30 10:25:51 +01:00
Martin Milata
3b138b4f98 feat(python): add experimental_features setting 2020-10-16 13:53:31 +02:00
matejcik
e4785d47e0 style: apply black 20.8b1 2020-09-29 11:30:40 +02:00
matejcik
6dda240f5c test(python): add flake8-requirements 2020-09-29 11:30:40 +02:00
Martin Milata
76a1760764 python: support SafetyChecks.PromptTemporarily 2020-09-18 09:02:40 +02:00
matejcik
ffe3b5487d python: ignore failures of EndSession call, so that end_session() does not raise 2020-08-28 15:37:06 +02:00
matejcik
e96a9e8d39 python/trezorctl: make use of EndSession 2020-08-28 15:37:06 +02:00
matejcik
17736e8fba python/trezorctl: fix output of 'btc get-address' help text 2020-08-27 15:19:53 +02:00
matejcik
d19f00b26c python/trezorctl: fix minor bugs in 'set homescreen' 2020-08-27 13:44:20 +02:00