Skip to content

Commit

Permalink
- update Cardano collector to work with ogmios API v6.1.x
Browse files Browse the repository at this point in the history
Signed-off-by: mchinaloy <[email protected]>
  • Loading branch information
mchinaloy committed Apr 29, 2024
1 parent 89b3d5c commit c2f6034
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
11 changes: 3 additions & 8 deletions src/collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from interfaces import WebsocketInterface, HttpsInterface
from helpers import validate_dict_and_return_key_value, strip_url


class EvmCollector():
"""A collector to fetch information about evm compatible RPC endpoints."""

Expand Down Expand Up @@ -116,13 +115,9 @@ def __init__(self, url, labels, chain_id, **client_parameters):
self.labels = labels
self.chain_id = chain_id
self.block_height_payload = {
"type": "jsonwsp/request",
"version": "1.0",
"servicename": "ogmios",
"methodname": "Query",
"args": {
"query": "blockHeight"
}
"id": "exporter",
"jsonrpc": "2.0",
"method": "queryNetwork/blockHeight"
}
self.interface = WebsocketInterface(
url, **client_parameters)
Expand Down
10 changes: 3 additions & 7 deletions src/test_collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,9 @@ def setUp(self):
self.chain_id = 123
self.client_params = {"param1": "dummy", "param2": "data"}
self.block_height_payload = {
"type": "jsonwsp/request",
"version": "1.0",
"servicename": "ogmios",
"methodname": "Query",
"args": {
"query": "blockHeight"
}
"id": "exporter",
"version": "2.0",
"methodname": "queryNetwork/blockHeight"
}
with mock.patch('collectors.WebsocketInterface') as mocked_websocket:
self.cardano_collector = collectors.CardanoCollector(
Expand Down

0 comments on commit c2f6034

Please sign in to comment.