Skip to content

Commit d2a4b6a

Browse files
committed
chore: fix typo issues
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
1 parent 0caf78d commit d2a4b6a

File tree

6 files changed

+23
-25
lines changed

6 files changed

+23
-25
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
77
## [Unreleased]
88

99
### Added
10-
- Add support for chunk message in `TopicSubmitMessageTransaction`.
10+
- Support for message chunking in `TopicSubmitMessageTransaction`.
1111

1212
## [0.1.9] - 2025-11-26
1313

examples/consensus/topic_message_submit_chunked.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
2-
uv run examples/topic_message_submit.py
3-
python examples/topic_message_submit.py
2+
uv run examples/consensus/topic_message_submit_chunked.py
3+
python examples/consensus/topic_message_submit_chunked.py
44
55
"""
66
import os
@@ -54,7 +54,7 @@ def setup_client():
5454

5555
print(f"Connecting to Hedera {network_name} network!")
5656

57-
try :
57+
try:
5858
network = Network(network_name)
5959
client = Client(network)
6060

@@ -83,7 +83,7 @@ def create_topic(client):
8383
)
8484
topic_id = topic_receipt.topic_id
8585

86-
print(f"Topic created: {topic_id}: {topic_id}")
86+
print(f"Topic created: {topic_id}")
8787

8888
return topic_id
8989
except Exception as e:
@@ -97,7 +97,7 @@ def submit_topic_message_transaction(client, topic_id):
9797
print("\nSubmitting large message...")
9898
try:
9999
message_receipt = (
100-
TopicMessageSubmitTransaction()
100+
TopicMessageSubmitTransaction()
101101
.set_topic_id(topic_id)
102102
.set_message(BIG_CONTENT)
103103
.freeze_with(client)
@@ -110,7 +110,7 @@ def submit_topic_message_transaction(client, topic_id):
110110

111111
print(f"Message submitted (status={ResponseCode(message_receipt.status)}, txId={message_receipt.transaction_id})")
112112
print(f"Message size:", len(BIG_CONTENT), "bytes")
113-
print(f"Message Content: {(BIG_CONTENT[:140] + "...") if len(BIG_CONTENT) > 40 else BIG_CONTENT}")
113+
print(f"Message Content: {(BIG_CONTENT[:140] + "...") if len(BIG_CONTENT) > 140 else BIG_CONTENT}")
114114
except Exception as e:
115115
print(f"Error: Message submission failed: {str(e)}")
116116
sys.exit(1)
@@ -123,7 +123,7 @@ def fetch_topic_info(client, topic_id):
123123

124124
try:
125125
info = TopicInfoQuery().set_topic_id(topic_id).execute(client)
126-
print (
126+
print(
127127
f"--- Topic Info ---\n"
128128
f"TopicId: {topic_id}\n"
129129
f"Memo: {info.memo}\n"
@@ -149,5 +149,3 @@ def main():
149149

150150
if __name__ == "__main__":
151151
main()
152-
153-

src/hiero_sdk_python/consensus/topic_message_submit_transaction.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def set_max_chunks(self, max_chunks: int) -> "TopicMessageSubmitTransaction":
115115
Set maximum allowed chunks.
116116
117117
Args:
118-
mac_chunks (int): The maximum number of chunks allowed.
118+
max_chunks (int): The maximum number of chunks allowed.
119119
120120
Returns:
121121
TopicMessageSubmitTransaction: This transaction instance (for chaining).
@@ -257,9 +257,7 @@ def freeze_with(self, client: "Client") -> "TopicMessageSubmitTransaction":
257257
if self.transaction_id is None:
258258
self.transaction_id = client.generate_transaction_id()
259259

260-
if len(self._transaction_ids) == 0:
261-
self._transaction_ids = []
262-
260+
if not self._transaction_ids:
263261
base_timestamp = self.transaction_id.valid_start
264262

265263
for i in range(self.get_required_chunks()):
@@ -310,7 +308,7 @@ def execute(self, client: "Client"):
310308
response = super().execute(client)
311309
responses.append(response)
312310

313-
# Return the first response JS SDK do
311+
# Return the first response as the JS SDK does
314312
return responses[0] if responses else None
315313

316314
def sign(self, private_key: "PrivateKey"):

src/hiero_sdk_python/query/topic_message_query.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ def run_stream():
163163

164164
except Exception as e:
165165
if subscription_handle.is_cancelled():
166-
167166
return
168167

169168
attempt += 1

tests/integration/topic_message_qurey_e2e_test.py renamed to tests/integration/topic_message_query_e2e_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def on_error_handler(e):
7575

7676
handle = query.subscribe(
7777
env.client,
78-
on_message=get_message,on_error=on_error_handler
78+
on_message=get_message,
79+
on_error=on_error_handler
7980
)
8081

8182
message_receipt = (

tests/integration/topic_message_submit_transaction_e2e_test.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_integration_topic_message_submit_transaction_can_execute(env):
5757
)
5858

5959
info = TopicInfoQuery(topic_id=topic_id).execute(env.client)
60-
# Check that no message is submited
60+
# Check that no message is submitted
6161
assert info.sequence_number == 0
6262

6363
message_transaction = TopicMessageSubmitTransaction(
@@ -73,7 +73,7 @@ def test_integration_topic_message_submit_transaction_can_execute(env):
7373
), f"Message submission failed with status: {ResponseCode(message_receipt.status).name}"
7474

7575
info = TopicInfoQuery(topic_id=topic_id).execute(env.client)
76-
# Check that one message is submited
76+
# Check that one message is submitted
7777
assert info.sequence_number == 1
7878

7979
delete_topic(env.client, topic_id)
@@ -121,7 +121,7 @@ def test_integration_topic_message_submit_transaction_with_submit_key(env):
121121
)
122122

123123
info = TopicInfoQuery(topic_id=topic_id).execute(env.client)
124-
# Check that no message is submited
124+
# Check that no message is submited
125125
assert info.sequence_number == 0
126126

127127
message_transaction = TopicMessageSubmitTransaction(
@@ -139,7 +139,7 @@ def test_integration_topic_message_submit_transaction_with_submit_key(env):
139139
), f"Message submission failed with status: {ResponseCode(message_receipt.status).name}"
140140

141141
info = TopicInfoQuery(topic_id=topic_id).execute(env.client)
142-
# Check that one message is submited
142+
# Check that one message is submited
143143
assert info.sequence_number == 1
144144

145145
delete_topic(env.client, topic_id)
@@ -157,7 +157,7 @@ def test_integration_topic_message_submit_transaction_without_submit_key_fails(e
157157
)
158158

159159
info = TopicInfoQuery(topic_id=topic_id).execute(env.client)
160-
# Check that no message is submited
160+
# Check that no message is submited
161161
assert info.sequence_number == 0
162162

163163
message_transaction = TopicMessageSubmitTransaction(
@@ -257,7 +257,8 @@ def test_integration_scheduled_topic_message_submit_transaction_can_execute_with
257257
balance.hbars.to_tinybars() == Hbar(3).to_tinybars()
258258
), f"Expected balance of 3 Hbar, but got {balance.hbars.to_tinybars()}"
259259

260-
env.client.set_operator(account.id, account.key) # Set the operator to the account
260+
# Restore the operator to the original account
261+
env.client.set_operator(account.id, account.key)
261262

262263
topic_message_submit_fee_limit = (
263264
CustomFeeLimit().set_payer_id(account.id).add_custom_fee(topic_fee)
@@ -285,7 +286,8 @@ def test_integration_scheduled_topic_message_submit_transaction_can_execute_with
285286
balance.hbars.to_tinybars() < Hbar(2).to_tinybars()
286287
), f"Expected balance of less than 2 Hbar, but got {balance.hbars.to_tinybars()}"
287288

288-
env.client.set_operator(operator_id, operator_key) # Set the operator to the account
289+
# Restore the operator to the original account
290+
env.client.set_operator(operator_id, operator_key)
289291
delete_topic(env.client, topic_id)
290292

291293

@@ -301,7 +303,7 @@ def test_integration_topic_message_submit_transaction_fails_if_required_chunk_gr
301303
)
302304

303305
info = TopicInfoQuery(topic_id=topic_id).execute(env.client)
304-
# Check that no message is submited
306+
# Check that no message is submited
305307
assert info.sequence_number == 0
306308

307309
message_transaction = TopicMessageSubmitTransaction(

0 commit comments

Comments
 (0)