From 71208fedd8846fdc34b5f62ef64a3be412d5064b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois?= Date: Thu, 19 Dec 2024 16:18:19 +0100 Subject: [PATCH] add get_blockclique_block_by_slot api call support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jean-François --- massa_test_framework/massa_jsonrpc_api/api.py | 13 +++++++++++++ massa_test_framework/node.py | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/massa_test_framework/massa_jsonrpc_api/api.py b/massa_test_framework/massa_jsonrpc_api/api.py index e9f7200..df9ab5b 100644 --- a/massa_test_framework/massa_jsonrpc_api/api.py +++ b/massa_test_framework/massa_jsonrpc_api/api.py @@ -113,6 +113,19 @@ def get_stakers(): ) return headers, payload + @staticmethod + def get_blockclique_block_by_slot(period: int, thread: int): + headers = {"Content-type": "application/json"} + payload = json.dumps( + { + "jsonrpc": "2.0", + "method": "get_blockclique_block_by_slot", + "id": 0, + "params": [{"period": period, "thread": thread}], + } + ) + return headers, payload + # class Api: # def __init__(self, url) -> None: diff --git a/massa_test_framework/node.py b/massa_test_framework/node.py index 56d38a1..21b4c9d 100644 --- a/massa_test_framework/node.py +++ b/massa_test_framework/node.py @@ -422,6 +422,11 @@ def get_stakers(self): print("get_stakers", res, type(res)) return res + def get_blockclique_block_by_slot(self, period: int, thread: int): + res = self.pub_api2.get_blockclique_block_by_slot(period, thread) + print("get_blockclique_block_by_slot", res, type(res)) + return res + # API GRPC async def _public_grpc_call(