mirror of
https://github.com/logos-blockchain/logos-blockchain-e2e-tests.git
synced 2026-01-02 13:13:08 +00:00
fix: add get_storage_block to storage
This commit is contained in:
parent
6af92fa449
commit
1fe6354ac6
@ -160,3 +160,6 @@ class NomosNode:
|
||||
|
||||
def send_get_commitments_request(self, data):
|
||||
return self._api.da_get_commitments(data)
|
||||
|
||||
def send_get_storage_block_request(self, data):
|
||||
return self._api.storage_block(data)
|
||||
|
||||
34
src/steps/storage.py
Normal file
34
src/steps/storage.py
Normal file
@ -0,0 +1,34 @@
|
||||
import allure
|
||||
from tenacity import retry, stop_after_delay, wait_fixed
|
||||
|
||||
from src.libs.custom_logger import get_custom_logger
|
||||
from src.steps.common import StepsCommon
|
||||
|
||||
logger = get_custom_logger(__name__)
|
||||
|
||||
|
||||
def prepare_get_storage_block_request(header_id):
|
||||
query_data = {"header_id": header_id}
|
||||
return query_data
|
||||
|
||||
|
||||
class StepsStorage(StepsCommon):
|
||||
@allure.step
|
||||
def get_storage_block(self, node, header_id, **kwargs):
|
||||
|
||||
timeout_duration = kwargs.get("timeout_duration", 65)
|
||||
interval = kwargs.get("interval", 0.1)
|
||||
|
||||
query = prepare_get_storage_block_request(header_id)
|
||||
|
||||
@retry(stop=stop_after_delay(timeout_duration), wait=wait_fixed(interval), reraise=True)
|
||||
def get_block():
|
||||
try:
|
||||
response = node.send_get_storage_block_request(query)
|
||||
except Exception as ex:
|
||||
logger.error(f"Exception while retrieving commitments: {ex}")
|
||||
raise
|
||||
|
||||
return response
|
||||
|
||||
return get_block()
|
||||
Loading…
x
Reference in New Issue
Block a user