1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-20 05:18:08 +00:00

add more eip155 test cases (#297)

This commit is contained in:
HackyMiner 2018-08-15 18:31:30 +09:00 committed by Pavol Rusnak
parent 5a677c3782
commit b938c52e85
2 changed files with 45 additions and 0 deletions

View File

@ -523,6 +523,11 @@ class ProtocolMixin(object):
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)

View File

@ -157,6 +157,46 @@ class TestMsgEthereumSigntxChainId(TrezorTest):
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()