Skip to content

Commit fc06121

Browse files
authored
- update Cardano collector to work with ogmios API v6.1.x (#59)
1 parent 01f4fc1 commit fc06121

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/collectors.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from interfaces import WebsocketInterface, HttpsInterface
33
from helpers import validate_dict_and_return_key_value, strip_url
44

5-
65
class EvmCollector():
76
"""A collector to fetch information about evm compatible RPC endpoints."""
87

@@ -116,13 +115,9 @@ def __init__(self, url, labels, chain_id, **client_parameters):
116115
self.labels = labels
117116
self.chain_id = chain_id
118117
self.block_height_payload = {
119-
"type": "jsonwsp/request",
120-
"version": "1.0",
121-
"servicename": "ogmios",
122-
"methodname": "Query",
123-
"args": {
124-
"query": "blockHeight"
125-
}
118+
"id": "exporter",
119+
"jsonrpc": "2.0",
120+
"method": "queryNetwork/blockHeight"
126121
}
127122
self.interface = WebsocketInterface(
128123
url, **client_parameters)

src/test_collectors.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,9 @@ def setUp(self):
188188
self.chain_id = 123
189189
self.client_params = {"param1": "dummy", "param2": "data"}
190190
self.block_height_payload = {
191-
"type": "jsonwsp/request",
192-
"version": "1.0",
193-
"servicename": "ogmios",
194-
"methodname": "Query",
195-
"args": {
196-
"query": "blockHeight"
197-
}
191+
"id": "exporter",
192+
"jsonrpc": "2.0",
193+
"method": "queryNetwork/blockHeight"
198194
}
199195
with mock.patch('collectors.WebsocketInterface') as mocked_websocket:
200196
self.cardano_collector = collectors.CardanoCollector(

0 commit comments

Comments
 (0)