Skip to content

Commit 17543f3

Browse files
Support "solo" network name
Signed-off-by: Alexander Shenshin <[email protected]>
1 parent 5dd2f22 commit 17543f3

File tree

12 files changed

+59
-55
lines changed

12 files changed

+59
-55
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Prepare Hiero Solo
4747
id: solo
48-
uses: hiero-ledger/hiero-solo-action@35efe2334bffb73298716402a5c688321ec29260
48+
uses: AlexanderShenshin/hiero-solo-action@v0.0.4-dev
4949
with:
5050
installMirrorNode: true
5151

hiero_did_sdk_python/did/did_syntax.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
HEDERA_NETWORK_MAINNET = "mainnet"
99
HEDERA_NETWORK_TESTNET = "testnet"
1010
HEDERA_NETWORK_PREVIEWNET = "previewnet"
11+
HEDERA_NETWORK_SOLO = "solo"
1112

1213
HEDERA_DID_METHOD = "hedera"
1314

hiero_did_sdk_python/did/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
HEDERA_DID_METHOD,
1010
HEDERA_NETWORK_MAINNET,
1111
HEDERA_NETWORK_PREVIEWNET,
12+
HEDERA_NETWORK_SOLO,
1213
HEDERA_NETWORK_TESTNET,
1314
)
1415

@@ -94,6 +95,7 @@ def parse_identifier(identifier: str) -> ParsedIdentifier:
9495
network_name != HEDERA_NETWORK_MAINNET
9596
and network_name != HEDERA_NETWORK_TESTNET
9697
and network_name != HEDERA_NETWORK_PREVIEWNET
98+
and network_name != HEDERA_NETWORK_SOLO
9799
):
98100
raise DidException("DID string is invalid. Invalid Hedera network.", DidErrorCode.INVALID_NETWORK)
99101

hiero_did_sdk_python/hcs/hcs_message_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .hcs_message_envelope import HcsMessageEnvelope
1111
from .hcs_topic_listener import HcsTopicListener
1212

13-
DEFAULT_TIMEOUT_SECONDS = float(5)
13+
DEFAULT_TIMEOUT_SECONDS = float(10)
1414

1515
TOPIC_UNSUBSCRIBED_ERROR = "CANCELLED: unsubscribe"
1616

hiero_did_sdk_python/hcs/hcs_topic_listener.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
from collections.abc import Callable
3+
from datetime import timedelta
34
from typing import cast
45

56
from hiero_sdk_python import Client, Timestamp, TopicId, TopicMessageQuery
@@ -28,15 +29,15 @@ def __init__(
2829
self._query = (
2930
TopicMessageQuery(topic_id=TopicId.from_string(topic_id), start_time=Timestamp(0, 0).to_date())
3031
.set_max_backoff(2.0)
31-
.set_max_attempts(5)
32+
.set_max_attempts(10)
3233
)
3334

3435
def set_start_time(self, start_time: Timestamp):
35-
self._query.set_start_time(start_time.to_date())
36+
self._query.set_start_time(start_time.to_date() - timedelta(minutes=120))
3637
return self
3738

3839
def set_end_time(self, end_time: Timestamp):
39-
self._query.set_end_time(end_time.to_date())
40+
self._query.set_end_time(end_time.to_date() + timedelta(minutes=120))
4041
return self
4142

4243
def set_limit(self, limit: int):

tests/integration/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"You can obtain them by creating developer account on https://portal.hedera.com/"
1515
)
1616

17+
NETWORK: str = os.environ.get("NETWORK") or "testnet"
18+
1719
OPERATOR_KEY = PrivateKey.from_string(OPERATOR_KEY_DER)
1820

1921
OPERATOR_KEY_TYPE = get_key_type(OPERATOR_KEY)
2022

21-
NETWORK = os.environ.get("NETWORK") or "testnet"
22-
2323

2424
@pytest.fixture(scope="class")
2525
def client():

tests/integration/demo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def test_demo(self, client: Client):
9393
)
9494

9595
# Wait until changes are propagated to Hedera Mirror node
96-
await asyncio.sleep(5)
96+
await asyncio.sleep(10)
9797

9898
# Create Hedera DID resolver instance
9999
did_resolver = HederaDidResolver(client)
@@ -135,7 +135,7 @@ async def test_demo(self, client: Client):
135135
)
136136

137137
# Wait until changes are propagated to Hedera Mirror node
138-
await asyncio.sleep(5)
138+
await asyncio.sleep(10)
139139

140140
print("Resolving schema object...")
141141

@@ -174,7 +174,7 @@ async def test_demo(self, client: Client):
174174
)
175175

176176
# Wait until changes are propagated to Hedera Mirror node
177-
await asyncio.sleep(5)
177+
await asyncio.sleep(10)
178178

179179
print("Resolving credential definition object...")
180180

@@ -224,7 +224,7 @@ async def test_demo(self, client: Client):
224224
)
225225

226226
# Wait until changes are propagated to Hedera Mirror node
227-
await asyncio.sleep(5)
227+
await asyncio.sleep(10)
228228

229229
print("Resolving revocation registry definition object...")
230230

@@ -257,7 +257,7 @@ async def test_demo(self, client: Client):
257257
rev_list_timestamp = int(time.time())
258258

259259
# Wait until changes are propagated to Hedera Mirror node
260-
await asyncio.sleep(5)
260+
await asyncio.sleep(10)
261261

262262
print(
263263
f"Revocation list has been registered, initial revocation entry can be found in HCS topic: https://hashscan.io/testnet/topic/{rev_reg_entries_topic_id}"
@@ -281,7 +281,7 @@ async def test_demo(self, client: Client):
281281
assert rev_list_update_result.revocation_list_state.state == "finished"
282282

283283
# Wait until changes are propagated to Hedera Mirror node
284-
await asyncio.sleep(5)
284+
await asyncio.sleep(10)
285285

286286
print("Resolving revocation list states...")
287287

tests/integration/test_hcs_file_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .conftest import OPERATOR_KEY_DER
1111

1212

13-
@pytest.mark.flaky(retries=3, delay=1)
13+
# @pytest.mark.flaky(retries=3, delay=1)
1414
@pytest.mark.asyncio(loop_scope="session")
1515
class TestHcsFileService:
1616
@pytest.mark.parametrize(
@@ -33,7 +33,7 @@ async def test_submit_and_resolve_file(
3333
topic_id = await service.submit_file(file_payload, OPERATOR_KEY_DER)
3434

3535
# Wait until changes are propagated to Hedera Mirror node
36-
await asyncio.sleep(5)
36+
await asyncio.sleep(10)
3737

3838
topic_info = await execute_hcs_query_async(TopicInfoQuery(topic_id=TopicId.from_string(topic_id)), client)
3939
topic_messages = await HcsMessageResolver(topic_id, HcsFileChunkMessage).execute(client)

tests/integration/test_hcs_topic_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from .conftest import OPERATOR_KEY
77

88

9-
@pytest.mark.flaky(retries=3, delay=1)
9+
# @pytest.mark.flaky(retries=3, delay=1)
1010
@pytest.mark.asyncio(loop_scope="session")
1111
class TestHcsTopicService:
1212
async def test_creates_and_updates_hcs_topic(self, client: Client):

tests/integration/test_hedera_anoncreds_registry.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
from hiero_did_sdk_python.anoncreds.utils import AnonCredsObjectType, parse_anoncreds_identifier
3333
from hiero_did_sdk_python.hcs import HcsMessageResolver
3434

35-
from .conftest import OPERATOR_KEY_DER
35+
from .conftest import NETWORK, OPERATOR_KEY_DER
3636

37-
ISSUER_ID = "did:hedera:testnet:zvAQyPeUecGck2EsxcsihxhAB6jZurFrBbj2gC7CNkS5o_0.0.5063027"
37+
ISSUER_ID = f"did:hedera:{NETWORK}:zvAQyPeUecGck2EsxcsihxhAB6jZurFrBbj2gC7CNkS5o_0.0.5063027"
3838

3939
MOCK_SCHEMA_PARAMS = {
4040
"name": "mock-schema",
@@ -69,7 +69,7 @@
6969
ACCUM_2 = "mock-accum-2"
7070

7171

72-
@pytest.mark.flaky(retries=3, delay=1)
72+
# @pytest.mark.flaky(retries=3, delay=1)
7373
@pytest.mark.asyncio(loop_scope="session")
7474
class TestHederaAnonCredsRegistry:
7575
async def test_creates_anoncreds_schema(self, client: Client, Something):
@@ -92,7 +92,7 @@ async def test_creates_anoncreds_schema(self, client: Client, Something):
9292
assert parsed_identifier.object_type == AnonCredsObjectType.SCHEMA
9393

9494
# Wait until changes are propagated to Hedera Mirror node
95-
await asyncio.sleep(5)
95+
await asyncio.sleep(10)
9696

9797
resolution_result = await registry.get_schema(schema_id)
9898

@@ -124,7 +124,7 @@ async def test_creates_anoncreds_cred_def(self, client: Client, Something):
124124
assert parsed_identifier.object_type == AnonCredsObjectType.PUBLIC_CRED_DEF
125125

126126
# Wait until changes are propagated to Hedera Mirror node
127-
await asyncio.sleep(5)
127+
await asyncio.sleep(10)
128128

129129
resolution_result = await registry.get_cred_def(cred_def_id)
130130

@@ -159,7 +159,7 @@ async def test_creates_anoncreds_rev_reg_def(self, client: Client, Something):
159159
assert parsed_identifier.object_type == AnonCredsObjectType.REV_REG
160160

161161
# Wait until changes are propagated to Hedera Mirror node
162-
await asyncio.sleep(5)
162+
await asyncio.sleep(10)
163163

164164
resolution_result = await registry.get_rev_reg_def(rev_reg_def_id)
165165

@@ -182,7 +182,7 @@ async def test_creates_and_updates_rev_list(self, client: Client, Something):
182182
assert rev_reg_def_id
183183

184184
# Wait until changes are propagated to Hedera Mirror node
185-
await asyncio.sleep(5)
185+
await asyncio.sleep(10)
186186

187187
rev_list = AnonCredsRevList(
188188
issuer_id=ISSUER_ID,
@@ -205,7 +205,7 @@ async def test_creates_and_updates_rev_list(self, client: Client, Something):
205205
assert rev_reg_entries_topic_id
206206

207207
# Wait until changes are propagated to Hedera Mirror node
208-
await asyncio.sleep(5)
208+
await asyncio.sleep(10)
209209

210210
entries_messages = await HcsMessageResolver(rev_reg_entries_topic_id, HcsRevRegEntryMessage).execute(client)
211211

@@ -240,7 +240,7 @@ async def test_creates_and_updates_rev_list(self, client: Client, Something):
240240
)
241241

242242
# Wait until changes are propagated to Hedera Mirror node
243-
await asyncio.sleep(5)
243+
await asyncio.sleep(10)
244244

245245
entries_messages = await HcsMessageResolver(rev_reg_entries_topic_id, HcsRevRegEntryMessage).execute(client)
246246

0 commit comments

Comments
 (0)