File tree Expand file tree Collapse file tree 2 files changed +488
-473
lines changed
core/pyspec/eth2spec/test/utils Expand file tree Collapse file tree 2 files changed +488
-473
lines changed Original file line number Diff line number Diff line change 1
- from hashlib import sha256
2
-
3
1
from eth_utils import (
4
2
encode_hex ,
5
3
int_to_big_endian ,
14
12
###############################################################################
15
13
16
14
17
- def expect_exception (func , * args ):
18
- try :
19
- func (* args )
20
- except Exception :
21
- pass
22
- else :
23
- raise Exception ("should have raised exception" )
24
-
25
-
26
15
def bls_add_one (x ):
27
16
"""
28
17
Adds "one" (actually bls.G1()) to a compressed group element.
@@ -31,15 +20,6 @@ def bls_add_one(x):
31
20
return bls .G1_to_bytes48 (bls .add (bls .bytes48_to_G1 (x ), bls .G1 ()))
32
21
33
22
34
- def hash (x ):
35
- return sha256 (x ).digest ()
36
-
37
-
38
- def make_id (* args ):
39
- values_str = "_" .join (str (arg ) for arg in args )
40
- return hash (bytes (values_str , "utf-8" ))[:8 ].hex ()
41
-
42
-
43
23
def field_element_bytes (x : int ):
44
24
assert x < spec .BLS_MODULUS
45
25
return int .to_bytes (x , 32 , spec .KZG_ENDIANNESS )
@@ -204,7 +184,3 @@ def evaluate_blob_at(blob, z):
204
184
CELL_INVALID_TOO_FEW_BYTES ,
205
185
CELL_INVALID_TOO_MANY_BYTES ,
206
186
]
207
-
208
- # Cells & Proofs
209
-
210
- VALID_CELLS_AND_PROOFS = [] # Saved in case02_compute_cells_and_kzg_proofs
You can’t perform that action at this time.
0 commit comments