mirror of
https://github.com/logos-co/nomos-specs.git
synced 2025-01-23 05:49:04 +00:00
Added missing test cases
This commit is contained in:
parent
312a46e209
commit
92c5a64b02
@ -25,7 +25,7 @@ class DAEncoder:
|
||||
def __init__(self, params: DAEncoderParams):
|
||||
self.params = params
|
||||
|
||||
def _chunkify_data(self) -> List[bytearray]:
|
||||
def _chunkify_data(self, data: bytearray) -> List[bytearray]:
|
||||
...
|
||||
|
||||
def _compute_row_kzg_commitments(self, rows: List[bytearray]) -> List[Commitment]:
|
||||
@ -46,7 +46,7 @@ class DAEncoder:
|
||||
...
|
||||
|
||||
def encode(self, data: bytearray) -> EncodedData:
|
||||
rows = self._chunkify_data()
|
||||
rows = self._chunkify_data(data)
|
||||
row_commitments = self._compute_row_kzg_commitments(rows)
|
||||
encoded_rows = self._rs_encode_rows(rows)
|
||||
row_proofs = self._compute_rows_proofs(encoded_rows, row_commitments)
|
||||
|
@ -1,7 +1,8 @@
|
||||
from typing import List
|
||||
from unittest import TestCase
|
||||
|
||||
from da import encoder
|
||||
from da.encoder import DAEncoderParams
|
||||
from da.encoder import DAEncoderParams, Commitment
|
||||
from eth2spec.eip7594.mainnet import BYTES_PER_FIELD_ELEMENT
|
||||
|
||||
|
||||
@ -15,6 +16,24 @@ class TestEncoder(TestCase):
|
||||
self.assertEqual(len(encoded_data.row_commitments), chunks_size)
|
||||
self.assertEqual(len(encoded_data.row_proofs), chunks_size)
|
||||
|
||||
def test_chunkify(self):
|
||||
pass
|
||||
|
||||
def test_compute_row_kzg_commitments(self, rows: List[bytearray]):
|
||||
pass
|
||||
|
||||
def test_rs_encode_rows(self, rows: List[bytearray]):
|
||||
pass
|
||||
|
||||
def test_compute_rows_proofs(self, rows: List[bytearray], row_commitments: List[bytearray]):
|
||||
pass
|
||||
|
||||
def test_compute_column_kzg_commitments(self, rows: List[bytearray]):
|
||||
pass
|
||||
|
||||
def test_generate_aggregated_column_commitments(self, rows: List[bytearray], column_commitments: List[Commitment]):
|
||||
pass
|
||||
|
||||
def test_encode(self):
|
||||
from random import randbytes
|
||||
sizes = [pow(2, exp) for exp in range(1, 8, 2)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user