From a526cdf446cbd84fc5d401512d4fd79ceef79e65 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Wed, 24 Apr 2024 00:21:45 +0800 Subject: [PATCH] Fix: use TypeVar for "point" rather than bytes --- pysetup/spec_builders/deneb.py | 1 + specs/deneb/polynomial-commitments.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pysetup/spec_builders/deneb.py b/pysetup/spec_builders/deneb.py index e1ad05184..dc3c17583 100644 --- a/pysetup/spec_builders/deneb.py +++ b/pysetup/spec_builders/deneb.py @@ -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 diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index a740ca7ef..5f7edb455 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -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 ... ```