mirror of
https://github.com/logos-blockchain/logos-blockchain-e2e-tests.git
synced 2026-01-02 13:13:08 +00:00
test: consensus compatibility
This commit is contained in:
parent
9d83b1a2c8
commit
e7c2141dd8
@ -1,6 +1,6 @@
|
||||
import logging
|
||||
|
||||
max_log_line_length = 5000
|
||||
max_log_line_length = 10000
|
||||
|
||||
|
||||
def log_length_filter(max_length):
|
||||
|
||||
@ -19,8 +19,23 @@ class TestApiCompatibility(StepsDataAvailability, StepsConsensus, StepsStorage):
|
||||
def test_da_consensus_compatibility(self):
|
||||
self.disperse_data(DATA_TO_DISPERSE[2], to_app_id(1), to_index(0))
|
||||
delay(5)
|
||||
rcv_data = self.get_data_range(self.node2, to_app_id(1), to_index(0), to_index(5))
|
||||
logger.debug(f"shares: {rcv_data}")
|
||||
shares = self.get_data_range(self.node2, to_app_id(1), to_index(0), to_index(5))
|
||||
logger.debug(f"shares: {shares}")
|
||||
aggregated_column_commitments = []
|
||||
rows_commitments = []
|
||||
for index_share in shares:
|
||||
if len(index_share[1]) != 0:
|
||||
for share in index_share[1]:
|
||||
a_c_c = share["aggregated_column_commitment"]
|
||||
if a_c_c not in aggregated_column_commitments:
|
||||
aggregated_column_commitments.append(a_c_c)
|
||||
logger.debug(f"a_c_c: {a_c_c}")
|
||||
|
||||
r_c = share["rows_commitments"]
|
||||
if r_c not in rows_commitments:
|
||||
rows_commitments.append(r_c)
|
||||
logger.debug(f"r_c: {rows_commitments}")
|
||||
|
||||
headers = self.get_cryptarchia_headers(self.node2)
|
||||
logger.debug(f"headers: {headers}")
|
||||
# get storage blocks for headerID
|
||||
@ -33,3 +48,21 @@ class TestApiCompatibility(StepsDataAvailability, StepsConsensus, StepsStorage):
|
||||
blob_ids.append(blob["id"])
|
||||
|
||||
logger.debug(f"blob ids: {blob_ids}")
|
||||
commitments = []
|
||||
for blob_id in blob_ids:
|
||||
commitment = self.get_shares_commitments(self.node2, blob_id)
|
||||
commitments.append(commitment)
|
||||
logger.debug(f"commitments: {commitments}")
|
||||
|
||||
rcv_aggregated_column_commitments = []
|
||||
rcv_rows_commitments = []
|
||||
for commitment in commitments:
|
||||
rcv_aggregated_column_commitments.append(commitment["aggregated_column_commitment"])
|
||||
for rcv_rows_commitment in commitment["rows_commitments"]:
|
||||
rcv_rows_commitments.append(rcv_rows_commitment)
|
||||
|
||||
# Check commitments from shares match commitments ceceived
|
||||
for a_c_c in aggregated_column_commitments:
|
||||
assert a_c_c in rcv_aggregated_column_commitments
|
||||
for r_c in rcv_rows_commitments:
|
||||
assert r_c in rcv_rows_commitments
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user