@@ -153,7 +153,8 @@ def test_eth_account_recover_message(web3):
153
153
b'\x0c u0\x84 \xe5 \xa8 )\x02 \x19 2L\x1a :\x86 \xd4 \x06 M\xed -\x15 \x97 \x9b \x1e \xa7 \x90 sJ\xaa ,\xea \xaf \xc1 "\x9c \xa4 S\x81 \x06 \x81 \x9f \xd3 \xa5 P\x9d \xd3 \x83 \xe8 \xfe Ks\x1c hp3\x95 V\xa5 \xc0 o\xeb \x9c \xf3 0\xbb \x00 ' , # noqa: E501
154
154
# test signature bytes with chain-naive v (27 in this case)
155
155
b'\x0c u0\x84 \xe5 \xa8 )\x02 \x19 2L\x1a :\x86 \xd4 \x06 M\xed -\x15 \x97 \x9b \x1e \xa7 \x90 sJ\xaa ,\xea \xaf \xc1 "\x9c \xa4 S\x81 \x06 \x81 \x9f \xd3 \xa5 P\x9d \xd3 \x83 \xe8 \xfe Ks\x1c hp3\x95 V\xa5 \xc0 o\xeb \x9c \xf3 0\xbb \x1b ' , # noqa: E501
156
- ]
156
+ ],
157
+ ids = ['test_sig_bytes_standard_v' , 'test_sig_bytes_chain_naive_v' ]
157
158
)
158
159
def test_eth_account_recover_signature_bytes (web3 , signature_bytes ):
159
160
msg_hash = b'\xbb \r \x8a \xba \x9f \xf7 \xa1 <N,s{i\x81 \x86 r\x83 {\xba \x9f \xe2 \x1d \xaa \xdd \xb3 \xd6 \x01 \xda \x00 \xb7 )\xa1 ' # noqa: E501
@@ -206,7 +207,8 @@ def test_eth_account_recover_vrs_standard_v(web3):
206
207
'Hello World' ,
207
208
HexBytes ('0xa1de988600a42c4b4ab089b619297c17d53cffae5d5120d82d8a92d0bb3b78f2' ),
208
209
),
209
- ]
210
+ ],
211
+ ids = ['message_to_sign' , 'hexstr_as_text' , 'hello_world' ]
210
212
)
211
213
def test_eth_account_hash_message_text (web3 , message , expected ):
212
214
assert web3 .eth .account .hashMessage (text = message ) == expected
@@ -223,7 +225,8 @@ def test_eth_account_hash_message_text(web3, message, expected):
223
225
'0x29d9f7d6a1d1e62152f314f04e6bd4300ad56fd72102b6b83702869a089f470c' ,
224
226
HexBytes ('0xe709159ef0e6323c705786fc50e47a8143812e9f82f429e585034777c7bf530b' ),
225
227
),
226
- ]
228
+ ],
229
+ ids = ['hexbytes_1' , 'hexbytes_2' ]
227
230
)
228
231
def test_eth_account_hash_message_hexstr (web3 , message , expected ):
229
232
assert web3 .eth .account .hashMessage (hexstr = message ) == expected
@@ -243,6 +246,7 @@ def test_eth_account_hash_message_hexstr(web3, message, expected):
243
246
HexBytes ('0xb91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a0291c' ), # noqa: E501
244
247
),
245
248
),
249
+ ids = ['account_1' ]
246
250
)
247
251
def test_eth_account_sign (web3 , message , key , expected_bytes , expected_hash , v , r , s , signature ):
248
252
signed = web3 .eth .account .sign (message_text = message , private_key = key )
@@ -277,6 +281,7 @@ def test_eth_account_sign(web3, message, key, expected_bytes, expected_hash, v,
277
281
37 ,
278
282
),
279
283
),
284
+ ids = ['account_1' ]
280
285
)
281
286
def test_eth_account_sign_transaction (web3 , txn , private_key , expected_raw_tx , tx_hash , r , s , v ):
282
287
signed = web3 .eth .account .signTransaction (txn , private_key )
0 commit comments