Skip to content

Commit 15d6b7d

Browse files
committed
correcting some issues in the test
Signed-off-by: Daniel Ntege <danientege785@gmail.com>
1 parent eca83e6 commit 15d6b7d

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/hiero_sdk_python/consensus/topic_create_transaction.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@ def _to_proto_key(self, key: Key | None):
195195
on `_to_proto_key` continue to work after centralizing the logic in
196196
`hiero_sdk_python.utils.key_utils.key_to_proto`.
197197
"""
198-
return key_to_proto(key)
198+
try:
199+
return key_to_proto(key)
200+
except TypeError as exc:
201+
raise TypeError("Key must be of type PrivateKey or PublicKey") from exc
199202

200203
def _build_proto_body(self) -> consensus_create_topic_pb2.ConsensusCreateTopicTransactionBody:
201204
"""

src/hiero_sdk_python/tokens/token_create_transaction.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,10 @@ def _to_proto_key(self, key: Key | None):
460460
on `_to_proto_key` continue to work after centralizing the logic in
461461
`hiero_sdk_python.utils.key_utils.key_to_proto`.
462462
"""
463-
return key_to_proto(key)
463+
try:
464+
return key_to_proto(key)
465+
except TypeError as exc:
466+
raise TypeError("Key must be of type PrivateKey or PublicKey") from exc
464467

465468
def _build_proto_body(self) -> token_create_pb2.TokenCreateTransactionBody:
466469
"""

0 commit comments

Comments
 (0)