File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ def test_keccak256():
2020 # "hello" -> 1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8
2121 assert keccak256 (b"hello" ).hex () == "1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8"
2222
23+ # "Transfer" -> 461a29a8a7db848c0827103038dd4776114eb182e0717208d0a793574936353d
24+ assert keccak256 (b"Transfer" ).hex () == "f099cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"
25+
2326
2427def test_compress_point_unchecked ():
2528 """Test point compression logic."""
@@ -59,6 +62,16 @@ def test_decompress_point():
5962 assert x2 == nums .x
6063 assert y2 == nums .y
6164
65+ # Test invalid length
66+ with pytest .raises (ValueError , match = "Not recognized" ):
67+ decompress_point (b'\x04 ' * 10 )
68+
69+ # Test invalid prefix
70+ with pytest .raises (ValueError , match = "Not recognized" ):
71+ # 0x05 is invalid prefix for 33-byte point
72+ invalid_point = b'\x05 ' + nums .x .to_bytes (32 , 'big' )
73+ decompress_point (invalid_point )
74+
6275
6376def test_compress_with_cryptography ():
6477 """Test compression using cryptography library."""
You can’t perform that action at this time.
0 commit comments