Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions trezorlib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@ def int_to_big_endian(value):
data, chunk = data[data_length:], data[:data_length]
response = self.call(proto.EthereumTxAck(data_chunk=chunk))

# https://github.com/trezor/trezor-mcu/pull/399
# only signature bit returned. recalculate signature_v
if response.signature_v <= 1:
response.signature_v += 2 * chain_id + 35

return response.signature_v, response.signature_r, response.signature_s

@expect(proto.EthereumMessageSignature)
Expand Down
40 changes: 40 additions & 0 deletions trezorlib/tests/device_tests/test_msg_ethereum_signtx_eip155.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,46 @@ def test_ethereum_signtx_eip155(self):
21004,
b"\0",
),
(
2147483630,
1,
4294967295,
b"fd0377ff429a51ae284c4b09b7d7c26c78944c86bb311b5988d70be4fc59eeba",
b"2ad183858ac6b1efa820b9ee2c2dbf6659a73cc5b714d32c380b263d024f2ee9",
0,
21004,
None,
),
(
2147483631,
1,
4294967298,
b"a4e89720285b179f679ecec1c79e4948b18ee4cf08f76b11d701cbead5e81a70",
b"094b32d3e53833c8085dadfe169782db4d32856d7b556f832f64dfdcfa1dd3b8",
100000000000000000,
21000,
None,
),
(
3125659152,
1,
6251318340,
b"a39e51d16cb10c81a9c1d9b071b714c4ecf112702407f1cc7aae35c85eced3d3",
b"0b0654665e4677c77510fc2a43026ee66c13261d3d893895bc49e6f4eaa5c8bd",
1,
21005,
None,
),
(
4294967295,
1,
8589934625,
b"3367230b5f506426f075f3137f4fd6a5fc4198326dd4936bbc38bf0c5ff43a5e",
b"6e48c3c95b3a534f7853a3b5dd72cdeffe9b7e93503eb7a793c9d5fdc14c4e99",
100000000000000000,
21000,
None,
),
]

self.setup_mnemonic_allallall()
Expand Down