Skip to content

Commit f2634db

Browse files
committed
final fix
Signed-off-by: Giannis <giannisgeorgiadiis@gmail.com>
1 parent 92ab148 commit f2634db

File tree

7 files changed

+35
-0
lines changed

7 files changed

+35
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Test shims for generated `hapi` modules.
2+
3+
These are minimal stand-ins used during unit testing when the real
4+
generated protobuf/grpc modules are not present.
5+
"""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Shim for `hiero_sdk_python.hapi.mirror` used in tests."""
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Minimal stub of generated gRPC module used by `client.Client` for tests."""
2+
3+
class ConsensusServiceStub:
4+
"""A tiny stub of the real gRPC stub. Methods are intentionally omitted."""
5+
6+
def __init__(self, channel):
7+
self._channel = channel
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Shim for `hiero_sdk_python.hapi.services` providing minimal protobuf stubs for tests."""
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Minimal shim for basic_types_pb2 used in tests."""
2+
3+
class _ProtoMessage:
4+
def CopyFrom(self, other):
5+
for k, v in getattr(other, "__dict__", {}).items():
6+
setattr(self, k, v)
7+
8+
9+
class TransactionID(_ProtoMessage):
10+
def __init__(self):
11+
self.accountID = _ProtoMessage()
12+
self.transactionValidStart = _ProtoMessage()
13+
self.scheduled = False
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Minimal shim for timestamp_pb2.Timestamp used in tests."""
2+
3+
class Timestamp:
4+
def __init__(self, seconds: int = 0, nanos: int = 0):
5+
self.seconds = int(seconds)
6+
self.nanos = int(nanos)

tools/_mypy_minimal.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[mypy]
2+
ignore_missing_imports = True

0 commit comments

Comments
 (0)