Skip to content

Commit 2c90166

Browse files
committed
chore: make default to tesnet to preseve backward compatiblity
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
1 parent 2c62356 commit 2c90166

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/hiero_sdk_python/client/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(
9898
Certificate verification is enabled by default for all networks.
9999
Use Client.set_transport_security() and Client.set_verify_certificates() to customize.
100100
"""
101-
self.network: str = network or "localhost"
101+
self.network: str = network or "testnet"
102102
self._mirror_address: str = mirror_address or self.MIRROR_ADDRESS_DEFAULT.get(self.network, "localhost:5600")
103103
self._mirror_channel: grpc.Channel | None = None
104104
self._mirror_stub: mirror_consensus_grpc.ConsensusServiceStub | None = None

tests/unit/client_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def test_for_network_with_hosted_network_forces_tls(network):
557557
assert client.network.is_transport_security() is True
558558

559559

560-
@pytest.mark.parametrize("network", ["local", "localhost", "solo", "custom", None])
560+
@pytest.mark.parametrize("network", ["local", "localhost", "solo", "custom"])
561561
def test_for_network_with_non_hosted_network_not_forces_tls(network):
562562
"""Test that if non hosted-net the port 50211 does not change."""
563563
network_map = {"127.0.0.1:50211": AccountId(0, 0, 3)}
@@ -569,7 +569,7 @@ def test_for_network_with_non_hosted_network_not_forces_tls(network):
569569
assert client.network.is_transport_security() is False
570570

571571

572-
@pytest.mark.parametrize("network", ["local", "localhost", "solo", "custom", None])
572+
@pytest.mark.parametrize("network", ["local", "localhost", "solo", "custom"])
573573
def test_for_network_with_non_hosted_network_not_downgrade_tls(network):
574574
"""Test that if non hosted-net the port 50212 does not change."""
575575
network_map = {"127.0.0.1:50212": AccountId(0, 0, 3)}

tests/unit/network_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,11 @@ def test_resolve_nodes_fallback_to_default(monkeypatch):
452452
assert resolved_nodes[0]._account_id == network.DEFAULT_NODES[network_name][0][1]
453453

454454

455-
def test_network_default_is_local():
456-
"""Test that a new Network defaults to localhost and non-tls."""
455+
def test_network_default_is_testnet():
456+
"""Test that a new Network defaults to testnet and tls."""
457457
network = Network()
458-
assert network.network == "localhost"
459-
assert network._transport_security is False
458+
assert network.network == "testnet"
459+
assert network._transport_security is True
460460

461461

462462
@pytest.mark.parametrize("network", ["mainnet", "previewnet", "testnet"])
@@ -483,7 +483,7 @@ def test_self_hosted_network_respect_port_50212(network):
483483
assert network._transport_security is True
484484

485485

486-
@pytest.mark.parametrize("network", ["local", "localhost", "solo", "custom", None])
486+
@pytest.mark.parametrize("network", ["local", "localhost", "solo", "custom"])
487487
def test_non_hosted_network_respects_port_50211(network):
488488
"""Test that on non-hosted network, port 50211 stays 50211 and remains non-tls."""
489489
node_50211 = _Node(AccountId(0, 0, 3), "127.0.0.1:50211", None)
@@ -495,7 +495,7 @@ def test_non_hosted_network_respects_port_50211(network):
495495
assert network._transport_security is False
496496

497497

498-
@pytest.mark.parametrize("network", ["local", "localhost", "solo", "custom", None])
498+
@pytest.mark.parametrize("network", ["local", "localhost", "solo", "custom"])
499499
def test_non_hosted_network_respect_port_50212(network):
500500
"""Test that on non hosted network respect port 50212"""
501501
node_50211 = _Node(AccountId(0, 0, 3), "127.0.0.1:50212", None)

0 commit comments

Comments
 (0)