Adding basic scenario to trigger sync

This commit is contained in:
aya 2025-05-24 21:02:29 +03:00
parent 5bdbd7dae0
commit 3c804d7d9b
4 changed files with 22 additions and 0 deletions

View File

@ -50,6 +50,12 @@ class REST(BaseClient):
def send_relay_message(self, message, pubsub_topic):
return self.rest_call("post", f"relay/v1/messages/{quote(pubsub_topic, safe='')}", json.dumps(message))
def send_sync_message(self, message):
return self.rest_call("post", "store/v1/messages", json.dumps(message))
def send_sync_request(self):
return self.rest_call("post", "store/v1/sync")
def send_relay_auto_message(self, message):
return self.rest_call("post", "relay/v1/auto/messages", json.dumps(message))

View File

@ -353,6 +353,12 @@ class WakuNode:
def send_relay_auto_message(self, message):
return self._api.send_relay_auto_message(message)
def send_sync_message(self, message):
return self._api.send_sync_message(message)
def request_sync(self):
return self.api.send_sync_request(self)
def send_light_push_message(self, payload):
return self._api.send_light_push_message(payload)

View File

@ -137,6 +137,9 @@ class StepsStore(StepsCommon):
delay(message_propagation_delay)
return self.message
def trigger_sync(self, sender=None):
sender.request_sync(self)
@retry(stop=stop_after_delay(30), wait=wait_fixed(1), reraise=True)
@allure.step
def get_messages_from_store_with_retry(self, node):

View File

@ -518,3 +518,10 @@ class TestE2E(StepsFilter, StepsStore, StepsRelay, StepsLightPush):
logger.debug("Check if node3 can inquiry stored message without stor peer specified")
store_response = self.node3.get_store_messages(pubsub_topic=self.test_pubsub_topic, page_size=5, ascending="true", store_v=store_version)
assert len(store_response["messages"]) == 2, "Can't find stored message!!"
def test_sync_trail(self):
self.node1.start(store="true", relay="true", sync="true")
self.node2.start(store="true", relay="false", discv5_bootstrap_node=self.node1.get_enr_uri())
# ogger.debug(f"publish mesage via store { self.publish_message(sender=self.node1,via ="sync")} ")
# logger.debug(f"return of sync request {self.node2.request_sync(self)}")