mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-07 15:43:07 +00:00
Full flow renaming
This commit is contained in:
parent
8550ce6086
commit
2b888b251f
@ -17,19 +17,18 @@ class DAVerifierWApi:
|
|||||||
self.api = DAApi(self.store)
|
self.api = DAApi(self.store)
|
||||||
self.verifier = DAVerifier()
|
self.verifier = DAVerifier()
|
||||||
|
|
||||||
def receive_blob(self, blob: DAShare):
|
def receive_blob(self, blob: DABlob):
|
||||||
if self.verifier.verify(blob):
|
if self.verifier.verify(blob):
|
||||||
# Warning: If aggregated col commitment and row commitment are the same,
|
# Warning: If aggregated col commitment and row commitment are the same,
|
||||||
# the build_attestation_message method will produce the same output.
|
# the build_attestation_message method will produce the same output.
|
||||||
cert_id = build_blob_id(blob.aggregated_column_commitment, blob.rows_commitments)
|
blob_id = build_blob_id(blob.aggregated_column_commitment, blob.rows_commitments)
|
||||||
self.store.populate(blob, cert_id)
|
self.store.populate(blob, blob_id)
|
||||||
return attestation
|
|
||||||
|
|
||||||
def receive_metadata(self, vid: BlobMetadata):
|
def receive_metadata(self, blob_metadata: BlobMetadata):
|
||||||
# Usually the certificate would be verifier here,
|
# Usually the certificate would be verifier here,
|
||||||
# but we are assuming that this it is already coming from the verified block,
|
# but we are assuming that this it is already coming from the verified block,
|
||||||
# in which case all certificates had been already verified by the DA Node.
|
# in which case all certificates had been already verified by the DA Node.
|
||||||
self.api.write(vid.blob_id, vid.metadata)
|
self.api.write(blob_metadata.blob_id, blob_metadata.metadata)
|
||||||
|
|
||||||
def read(self, app_id, indexes) -> List[Optional[DAShare]]:
|
def read(self, app_id, indexes) -> List[Optional[DAShare]]:
|
||||||
return self.api.read(app_id, indexes)
|
return self.api.read(app_id, indexes)
|
||||||
@ -67,14 +66,14 @@ class TestFullFlow(TestCase):
|
|||||||
# inject mock send and await method
|
# inject mock send and await method
|
||||||
self.dispersal._send_and_await_response = __send_and_await_response
|
self.dispersal._send_and_await_response = __send_and_await_response
|
||||||
blob_id = build_blob_id(encoded_data.aggregated_column_commitment, encoded_data.row_commitments)
|
blob_id = build_blob_id(encoded_data.aggregated_column_commitment, encoded_data.row_commitments)
|
||||||
vid = BlobMetadata(
|
blob_metadata = BlobMetadata(
|
||||||
blob_id,
|
blob_id,
|
||||||
Metadata(app_id, index)
|
Metadata(app_id, index)
|
||||||
)
|
)
|
||||||
|
|
||||||
# verifier
|
# verifier
|
||||||
for node in self.api_nodes:
|
for node in self.api_nodes:
|
||||||
node.receive_metadata(vid)
|
node.receive_metadata(blob_metadata)
|
||||||
|
|
||||||
# read from api and confirm its working
|
# read from api and confirm its working
|
||||||
# notice that we need to sort the api_nodes by their public key to have the blobs sorted in the same fashion
|
# notice that we need to sort the api_nodes by their public key to have the blobs sorted in the same fashion
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user