Fix: use TypeVar for "point" rather than bytes

This commit is contained in:
Hsiao-Wei Wang 2024-04-24 00:21:45 +08:00
parent bd48cefdd7
commit a526cdf446
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
2 changed files with 3 additions and 2 deletions

View File

@ -17,6 +17,7 @@ from eth2spec.capella import {preset_name} as capella
def preparations(cls):
return '''
T = TypeVar('T') # For generic function
TPoint = TypeVar('TPoint') # For generic function. G1 or G2 point.
'''
@classmethod

View File

@ -153,8 +153,8 @@ def bit_reversal_permutation(sequence: Sequence[T]) -> Sequence[T]:
This function performs a multi-scalar multiplication between `points` and `integers`. `points` can either be in G1 or G2.
```python
def multi_exp(points: PyUnion[Sequence[G1Point], Sequence[G2Point]],
integers: Sequence[uint64]) -> PyUnion[Sequence[G1Point], Sequence[G2Point]]:
def multi_exp(points: Sequence[TPoint],
integers: Sequence[uint64]) -> Sequence[TPoint]:
# pylint: disable=unused-argument
...
```