mirror of
https://github.com/logos-blockchain/logos-blockchain-e2e-tests.git
synced 2026-01-02 13:13:08 +00:00
fix: add get_shares_commitments to da
This commit is contained in:
parent
19d4b04a55
commit
6af92fa449
@ -43,6 +43,12 @@ def to_app_id(n: int) -> list:
|
||||
return list(n.to_bytes(32, byteorder="big"))
|
||||
|
||||
|
||||
def to_blob_id(n: int) -> list:
|
||||
if n < 0:
|
||||
raise ValueError("Input must be an unsigned integer (non-negative)")
|
||||
return list(n.to_bytes(32, byteorder="big"))
|
||||
|
||||
|
||||
def random_divide_k(n, k):
|
||||
if n < k:
|
||||
raise ValueError(f"n={n} must be at least k={k} to split into {k} parts")
|
||||
|
||||
@ -157,3 +157,6 @@ class NomosNode:
|
||||
|
||||
def send_get_data_range_request(self, data):
|
||||
return self._api.da_get_range(data)
|
||||
|
||||
def send_get_commitments_request(self, data):
|
||||
return self._api.da_get_commitments(data)
|
||||
|
||||
@ -28,6 +28,11 @@ def prepare_get_range_request(app_id, start_index, end_index):
|
||||
return query_data
|
||||
|
||||
|
||||
def prepare_get_shares_commitments_request(blob_id):
|
||||
query_data = {"blob_id": blob_id}
|
||||
return query_data
|
||||
|
||||
|
||||
def response_contains_data(response):
|
||||
if response is None:
|
||||
return False
|
||||
@ -101,3 +106,23 @@ class StepsDataAvailability(StepsCommon):
|
||||
return response
|
||||
|
||||
return get_range()
|
||||
|
||||
@allure.step
|
||||
def get_shares_commitments(self, node, blob_id, **kwargs):
|
||||
|
||||
timeout_duration = kwargs.get("timeout_duration", 65)
|
||||
interval = kwargs.get("interval", 0.1)
|
||||
|
||||
query = prepare_get_shares_commitments_request(blob_id)
|
||||
|
||||
@retry(stop=stop_after_delay(timeout_duration), wait=wait_fixed(interval), reraise=True)
|
||||
def get_commitments():
|
||||
try:
|
||||
response = node.send_get_commitments_request(query)
|
||||
except Exception as ex:
|
||||
logger.error(f"Exception while retrieving commitments: {ex}")
|
||||
raise
|
||||
|
||||
return response
|
||||
|
||||
return get_commitments()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user