Skip to content

Commit 2a73342

Browse files
Rename all instances of starkware to starknet (#61)
1 parent 96e3238 commit 2a73342

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Exporter currently supports all EVM-compatible chains. In addition, there is lim
88
- Bitcoin (https)
99
- Dogecoin (https)
1010
- Filecoin (https)
11-
- Starkware (https)
11+
- Starknet (https)
1212

1313
## Available Metrics
1414

src/collectors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ def latency(self):
318318
return self.interface.latest_query_latency
319319

320320

321-
class StarkwareCollector():
322-
"""A collector to fetch information about starkware RPC endpoints."""
321+
class StarknetCollector():
322+
"""A collector to fetch information about starknet RPC endpoints."""
323323

324324
def __init__(self, url, labels, chain_id, **client_parameters):
325325

src/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def endpoints(self):
4747
def _load_configuration(self):
4848
allowed_providers = self._load_validation_file()
4949
supported_collectors = ('evm', 'cardano', 'conflux', 'solana',
50-
'bitcoin', 'doge', 'filecoin', 'starkware')
50+
'bitcoin', 'doge', 'filecoin', 'starknet')
5151

5252
configuration_schema = Schema({
5353
'blockchain':

src/registries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def get_collector_registry(self) -> list:
7979
collector = collectors.FilecoinCollector
8080
case "solana", "solana":
8181
collector = collectors.SolanaCollector
82-
case "starkware", "starkware":
83-
collector = collectors.StarkwareCollector
82+
case "starknet", "starknet":
83+
collector = collectors.StarknetCollector
8484
case "evm", other: # pylint: disable=unused-variable
8585
collector = collectors.EvmCollector
8686
if collector is None:

src/test_collectors.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,8 @@ def test_latency(self):
591591
self.assertEqual(0.123, self.solana_collector.latency())
592592

593593

594-
class TestStarkwareCollector(TestCase):
595-
"""Tests the starkware collector class"""
594+
class TestStarknetCollector(TestCase):
595+
"""Tests the starknet collector class"""
596596

597597
def setUp(self):
598598
self.url = "wss://test.com"
@@ -608,45 +608,45 @@ def setUp(self):
608608
"id": 1
609609
}
610610
with mock.patch('collectors.HttpsInterface') as mocked_connection:
611-
self.starkware_collector = collectors.StarkwareCollector(
611+
self.starknet_collector = collectors.StarknetCollector(
612612
self.url, self.labels, self.chain_id, **self.client_params)
613613
self.mocked_connection = mocked_connection
614614

615615
def test_https_interface_created(self):
616-
"""Tests that the starkware collector calls the https interface with the correct args"""
616+
"""Tests that the starknet collector calls the https interface with the correct args"""
617617
self.mocked_connection.assert_called_once_with(
618618
self.url, self.open_timeout, self.ping_timeout)
619619

620620
def test_interface_attribute_exists(self):
621621
"""Tests that the interface attribute exists.
622622
May be used by external calls to access objects such as the interface cache"""
623-
self.assertTrue(hasattr(self.starkware_collector, 'interface'))
623+
self.assertTrue(hasattr(self.starknet_collector, 'interface'))
624624

625625
def test_alive_call(self):
626626
"""Tests the alive function uses the correct call and args"""
627-
self.starkware_collector.alive()
627+
self.starknet_collector.alive()
628628
self.mocked_connection.return_value.cached_json_rpc_post.assert_called_once_with(
629629
self.block_height_payload)
630630

631631
def test_alive_false(self):
632632
"""Tests the alive function returns false when post returns None"""
633633
self.mocked_connection.return_value.cached_json_rpc_post.return_value = None
634-
result = self.starkware_collector.alive()
634+
result = self.starknet_collector.alive()
635635
self.assertFalse(result)
636636

637637
def test_block_height(self):
638638
"""Tests the block_height function uses the correct call and args to get block height"""
639-
self.starkware_collector.block_height()
639+
self.starknet_collector.block_height()
640640
self.mocked_connection.return_value.cached_json_rpc_post.assert_called_once_with(
641641
self.block_height_payload)
642642

643643
def test_block_height_returns_none(self):
644644
"""Tests that the block height returns None if json_rpc_post returns None"""
645645
self.mocked_connection.return_value.cached_json_rpc_post.return_value = None
646-
result = self.starkware_collector.block_height()
646+
result = self.starknet_collector.block_height()
647647
self.assertEqual(None, result)
648648

649649
def test_latency(self):
650650
"""Tests that the latency is obtained from the interface based on latest_query_latency"""
651651
self.mocked_connection.return_value.latest_query_latency = 0.123
652-
self.assertEqual(0.123, self.starkware_collector.latency())
652+
self.assertEqual(0.123, self.starknet_collector.latency())

src/test_registries.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ def test_get_collector_registry_for_solana(self):
120120
helper_test_collector_registry(self, collector)
121121

122122
@mock.patch.dict(os.environ, {
123-
"CONFIG_FILE_PATH": "tests/fixtures/configuration_starkware.yaml",
123+
"CONFIG_FILE_PATH": "tests/fixtures/configuration_starknet.yaml",
124124
"VALIDATION_FILE_PATH": "tests/fixtures/validation.yaml"
125125
})
126-
def test_get_collector_registry_for_starkware(self):
127-
"""Tests that the starkware collector is called with the correct args"""
126+
def test_get_collector_registry_for_starknet(self):
127+
"""Tests that the starknet collector is called with the correct args"""
128128
self.collector_registry = CollectorRegistry()
129-
with mock.patch('collectors.StarkwareCollector', new=mock.Mock()) as collector:
129+
with mock.patch('collectors.StarknetCollector', new=mock.Mock()) as collector:
130130
helper_test_collector_registry(self, collector)
131131

132132
@mock.patch.dict(os.environ, {

src/tests/fixtures/configuration_starkware.yaml renamed to src/tests/fixtures/configuration_starknet.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
blockchain: "starkware"
1+
blockchain: "starknet"
22
chain_id: 1234
33
network_name: "TestNetwork"
44
network_type: "Mainnet"
5-
collector: "starkware"
5+
collector: "starknet"
66
endpoints:
77
- url: wss://test1.com
88
provider: TestProvider1

0 commit comments

Comments
 (0)